This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var SingletonFactory = (function () { | |
| var instance; | |
| var singletonObj = { | |
| init: function (options) { | |
| options = options || {}; | |
| this.name = "objJakiśTam"; // nazwa obiektu zainicjonowanego pojedyńczego | |
| this.pointX = options.pointX || 6; | |
| return this; | |
| } | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "use strict"; | |
| /* | |
| ========================================================================== | |
| XXX.JS | |
| ========================================================================== | |
| */ | |
| ///////////////////////////////////////// src ////////////////// | |
| // var otworz = require('./src/otworz.js'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('>>>>>>>>>>> testowanie backup z promisem', function (done) { | |
| this.timeout(20000); | |
| explorer.zipujKatalog("test/testowy2.zip", "node_modules") | |
| .then(function (msg) { | |
| var current = stdout.inspect(); | |
| console.log(msg); | |
| current.restore(); | |
| var actual = []; | |
| expect(current.output).to.deep.equal(actual); | |
| done(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Promise = require('bluebird'); | |
| // https://github.com/petkaantonov/bluebird | |
| var XXX = function() { | |
| return new Promise(function(resolve, reject) { | |
| setTimeout(function () { | |
| console.log ("[aSync fun2]"); | |
| resolve(); | |
| }, 1000); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var expexted = 1; | |
| var actual = 2; | |
| expect(actual).to.deep.equal(expexted); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| ========================================================================== | |
| TEST - XXX.js | |
| ========================================================================== | |
| */ | |
| ///////////////////////////////////////// dep utils //////////// | |
| var expect = require("chai").expect; | |
| // http://chaijs.com/api/bdd/ | |
| ///////////////////////////////////////// src ////////////////// | |
| var XXX = require("../src/XXX.js"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "use strict"; | |
| /* | |
| ========================================================================== | |
| XXX | |
| ========================================================================== | |
| */ | |
| ///////////////////////////////////////// dep utils //////////// | |
| ///////////////////////////////////////// src ////////////////// | |
| ///////////////////////////////////////// vars ///////////////// | |
| ///////////////////////////////////////// main ///////////////// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var factorial = function(number) { | |
| if (number <= 0) { // terminal case | |
| return 1; | |
| } else { // block to execute | |
| return (number * factorial(number - 1)); | |
| } | |
| }; | |
| console.log(factorial(6)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // js: porownanie schodkowe | |
| var SSS = XXX === 'cos1' ? 'opcja1' : | |
| XXX === 'cos2' ? 'opcja2' : | |
| XXX === 'cos3' ? 'opcja3' : | |
| 'opcja4' ; // fallback | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // js: #node module exports | |
| exports = module.exports = { | |
| greet: greet, | |
| doSth: function () { | |
| greet(); | |
| } | |
| }; |