{"_id":"justtest","_rev":"21-e6322ef9114ba0cb87dcae15fae2da77","name":"justtest","description":"Unit tests with JSDOM wrapper.","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"justtest","version":"0.0.1","main":"./lib/justtest.js","description":"Unit tests with JSDOM wrapper.","keywords":["unittest","dom","test"],"author":{"name":"Josh Marshall","email":"catchjosh@gmail.com","url":"http://openjosh.com"},"bugs":{"email":"catchjosh@gmail.com","url":"http://github.com/joshmarshall/justtest/issues"},"licenses":[{"type":"MIT","url":"http://github.com/joshmarshall/justtest/blob/master/LICENSE.txt"}],"repositories":[{"type":"git","url":"http://github.com/joshmarshall/justtest.git"}],"directories":{"lib":"./lib","bin":"./bin"},"dependencies":{"console.log":"*","colors":"*","jsdom":"0.2.x","request":"*"},"bin":{"test.js":"./bin/test.js"},"engines":{"node":"0.5.x"},"_id":"justtest@0.0.1","_engineSupported":false,"_npmVersion":"0.3.15","_nodeVersion":"v0.4.3","files":[""],"_defaultsLoaded":true,"dist":{"shasum":"59bcf72f08dacc3c5312f42f5e9307d12572a4bb","tarball":"https://registry.npmjs.org/justtest/-/justtest-0.0.1.tgz","integrity":"sha512-wP2pT4wzgyEzXQC7OtcOuUJMa2SPqVwsPup/4y9xHAtD9kCZo/elDe55CG2OC4bxt4uxmSfNyOntXe1FziK0Iw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHmH0FemcuWD94oIeCbkPCAF25D+Rl45LHsLekypbKQGAiEAwbq4Mx09mLNXkHCf7dNKFyjy7HPSNTBjQNpQ0FLT9x4="}]},"maintainers":[{"name":"joshmarshall","email":"catchjosh@gmail.com"}]},"0.0.2":{"name":"justtest","version":"0.0.2","main":"./lib/justtest.js","description":"Unit tests with JSDOM wrapper.","keywords":["unittest","dom","test"],"author":{"name":"Josh Marshall","email":"catchjosh@gmail.com","url":"http://openjosh.com"},"bugs":{"email":"catchjosh@gmail.com","url":"http://github.com/joshmarshall/justtest/issues"},"licenses":[{"type":"MIT","url":"http://github.com/joshmarshall/justtest/blob/master/LICENSE.txt"}],"repositories":[{"type":"git","url":"http://github.com/joshmarshall/justtest.git"}],"directories":{"lib":"./lib"},"dependencies":{"console.log":"*","jsdom":"0.2.x","request":"*","xmlhttprequest":"*","nodeunit":"*"},"engines":{"node":"0.5.x"},"_id":"justtest@0.0.2","_engineSupported":false,"_npmVersion":"0.3.15","_nodeVersion":"v0.4.3","dist":{"shasum":"9d9bb8272567fc2d7a057bc31e9d75b45c763ccc","tarball":"https://registry.npmjs.org/justtest/-/justtest-0.0.2.tgz","integrity":"sha512-li0z/zujAobEvFI4Ka0u6WYVUDNXvz9HlJvlHYkgAZwSmvsRFZ/JNzbxSMjhy0pJNnqeyczXW1YKqte0E5nttQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHmxZfG/wTjUOHTB/2Ls1+TMUgBHAtdVyjLYLGAFQsQFAiEAp50fhjvwLcSFgXCzeyhn3ssxY3vaRswOgAqN108OLJk="}]},"maintainers":[{"name":"joshmarshall","email":"catchjosh@gmail.com"}]},"0.0.3":{"name":"justtest","version":"0.0.3","main":"./lib/justtest.js","description":"Unit tests with JSDOM wrapper.","keywords":["unittest","dom","test"],"author":{"name":"Josh Marshall","email":"catchjosh@gmail.com","url":"http://openjosh.com"},"bugs":{"email":"catchjosh@gmail.com","url":"http://github.com/joshmarshall/justtest/issues"},"licenses":[{"type":"MIT","url":"http://github.com/joshmarshall/justtest/blob/master/LICENSE.txt"}],"repositories":[{"type":"git","url":"http://github.com/joshmarshall/justtest.git"}],"directories":{"lib":"./lib"},"dependencies":{"console.log":"*","jsdom":"0.2.x","request":"*","xmlhttprequest":"*","nodeunit":"*"},"engines":{"node":"node >= 0.5.x"},"_npmUser":{"name":"joshmarshall","email":"catchjosh@gmail.com"},"_id":"justtest@0.0.3","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.16","_nodeVersion":"v0.7.8-pre","_defaultsLoaded":true,"dist":{"shasum":"79be80e55ad6535f56cb7e948b8ad328bca006fe","tarball":"https://registry.npmjs.org/justtest/-/justtest-0.0.3.tgz","integrity":"sha512-0bB4v5Qv9AuTsB42dCRzlLLDG9iPjtzYt4Tbq0pExLrZhZgpfQVUC5zNALtXiPX54sDl1Fjxptxbcv7r/Sdvyg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEIvyYHY/9jzzw2tmBC8CR9cfSDwgYWBsMbnb75EUkjQIgK+U1NrQ7/FJPtwQpBPYQ27HDDeDE8alcJOfs84emDKk="}]},"readme":"JuStTest\n========\nThis is YAJTL (Yet Another Javascript Testing Library.) It's designed to\ntest client-side libraries without a browser, while still supporting\nasync behavior when mocking that out is just too complicated.\n\nIt's pretty much just a wrapper around existing tools like JSDom and NodeUnit.\n\nInstallation\n------------\nCurrently, it is only available via git at\nhttp://github.com/joshmarshall/justtest . Once you have downloaded the\nproject, you can install to your current directory with:\n\n    npm install path/to/justtest\n\nUsage\n-----\nBy default, it passes everything through to NodeUnit, so a basic test\nlooks like:\n\n    module.exports = {\n\n        testSomething: function(test) {\n            test.ok(true);\n            test.done();\n        }\n\n    };\n\n...and you can call it with the nodeunit executable like:\n\n    nodeunit tests/test_basic.js\n\nThe binary may be in different places depending on how you installed\nit, so the path could be `./node_modules/.bin/nodeunit` , or it might\nbe globally available as  `nodeunit`, or even something hideous like\n`./node_modules/justtest/node_modules/.bin/nodeunit`.\n\nTesting Browser-ish Javascript\n------------------------------\nOnce you move beyond simple unit tests, any real usage is going to require\nexternal dependencies. A sample project structure might look like:\n\n    ./\n    ./base.htm\n    ./js\n    ./js/jquery.min.js\n    ./js/myawesome.js\n    ./tests\n    ./tests/test_advanced.js\n\n...and test\\_advanced.js might look something like:\n\n    var domTest = require(\"justtest\").domTestCase;\n\n    module.exports = domTest({\n\n        html: \"../base.htm\",\n        scripts: [\"../jquery.js\", \"../myawesome.js\",],\n\n        // setting the default window properties to load\n        exportGlobals: [\"jQuery\"],\n\n        setUp: function(callback) {\n            // optional: do some set up stuff here...\n            this.globals.myAwesomeVar = true;\n            callback();\n        },\n\n        testjQuery: function(test) {\n            // test.globals holds anything in exportGlobals\n            test.equals(this.globals.myAwesomeVar, true);\n            var title = this.globals.jQuery(\"h1\").text()\n            test.equals(title, \"LOL I HAZ A CAT\");\n            test.done();\n        },\n\n        testMyLibrary: function(test) {\n            // window is always attached to test.globals\n            // (document is available with test.globals.window.document)\n            var result = this.globals.window.MyAwesomeObject.doIHazCat();\n            test.ok(result);\n            test.done();\n        },\n\n        testWithCallback: function(test) {\n            // use test.wrap around any callbacks.\n            var $ = this.globals.jQuery;\n            $.get(\"http://www.google.com\", test.wrap(function(data) {\n                // ...test response...\n                test.done();\n            });\n        },\n\n        tearDown: function(callback) {\n            // optional: undo what you did in setUp\n            callback();\n        }\n\n    });\n\nThe options that can be passed into domTestCase are listed below.\n\nRunning Tests\n-------------\nI've gotten rid of the custom test runner that used to be in this project\nand coupled it more with NodeUnit. Just refer to the NodeUnit project for\nthe options that you can pass to it.\n\ndomTestCase Options\n-------------------\nThe following is a list of options that domTestCase uses.\n\n* setUp: function(callback) - Provides a custom setUp to be called after\n  domTestCase has finished setting up.\n* tearDown: function(callback) - Provides a custom tearDown function to be\n  called after domTest as finished running tests.\n* htmlPath: string - A path to the HTML content that will be loaded by JSDOM.\n* html: string - raw HTML to be used as the DOM base.\n* scriptPath: string - The \"base\" path for anything provided to scripts.\n* scripts: array - A list of local Javascript files to load.\n* exportGlobals: array - A list of top-level objects to make avalable on the\n  domTestCase. These can be used within tests by \"test.globals.NAME\".\n\nAdditionally, justtest.defaultGlobals allows overriding of what's included\non every test by default.\n\nContact\n-------\nThis is really, really alpha. So please add Issues, or send me your\nsuccess or failure stories. I'd also love patches / ideas / etc. :)\n","maintainers":[{"name":"joshmarshall","email":"catchjosh@gmail.com"}]}},"maintainers":[{"name":"joshmarshall","email":"catchjosh@gmail.com"}],"time":{"modified":"2022-06-19T07:30:23.221Z","created":"2011-09-16T17:53:18.659Z","0.0.1":"2011-09-16T17:53:19.157Z","0.0.2":"2011-09-17T03:29:51.351Z","0.0.3":"2012-07-02T06:17:15.645Z"},"author":{"name":"Josh Marshall","email":"catchjosh@gmail.com","url":"http://openjosh.com"}}