{"id":13671303,"url":"https://github.com/peerigon/nof5","last_synced_at":"2025-04-27T14:33:18.504Z","repository":{"id":3574701,"uuid":"4637271","full_name":"peerigon/nof5","owner":"peerigon","description":"A tool which runs unit tests (based on mocha) if a file has changed on the server in a browser","archived":true,"fork":false,"pushed_at":"2017-11-06T11:30:17.000Z","size":504,"stargazers_count":53,"open_issues_count":9,"forks_count":11,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-05T17:02:31.815Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peerigon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-06-12T12:53:51.000Z","updated_at":"2025-01-25T05:11:53.000Z","dependencies_parsed_at":"2022-08-29T14:11:47.442Z","dependency_job_id":null,"html_url":"https://github.com/peerigon/nof5","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peerigon%2Fnof5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peerigon%2Fnof5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peerigon%2Fnof5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peerigon%2Fnof5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peerigon","download_url":"https://codeload.github.com/peerigon/nof5/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251154440,"owners_count":21544500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T09:01:05.533Z","updated_at":"2025-04-27T14:33:17.774Z","avatar_url":"https://github.com/peerigon.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# nof5\n\nis a server that runs **Unit Tests** with the help of test-suites like\n\n- [QUnit](http://qunitjs.com/) or\n- [Mocha](http://visionmedia.github.com/mocha/)\n\non any number of mobile or desktop browsers simultaneously and automatically.\nnof5 is independent of these test suites and can be used with any suite.\nTherefore is should be simple to integrate nof5 with existing tests.\nnof5 is based on\n\n- [express](http://expressjs.com/) and\n- [socket.io](http://socket.io/)\n\nIt also supports *Web-Bundler*s such as\n\n- [browserify](https://github.com/substack/node-browserify) or\n- [webpack](https://github.com/webpack/webpack)\n\nand can be customized to one's own needs with the help of **Hooks** as\n\n- before\n- beforeEach\n\nAdditionally nof5 supports the **xUnit** format and can therefore be integrated in **Continuous Integration** servers such as\n\n- [Jenkins](http://jenkins-ci.org/)\n\n\n## Motivation\n\nWe originally built nof5 for our client-and server-side framework [alamid.js] (http://alamidjs.com/).\n[alamid.js] (http://alamidjs.com/) makes it possible that the client code can be written exactly as for the server.\nWe use for the classes of [alamid.js] (http://alamidjs.com/) our JavaScript compiler [nodeclass] (https://npmjs.org/package/nodeclass)\nand the client-side code will be bundled with the help of [WebPack] (https://github.com/webpack/webpack).\nWe also develop [alamid.js](http://alamidjs.com/) using Contiuous integration and Jenkins.\nThere was no tool that combines all these technologies.\n\n## Installation\n\n\u003ccode\u003enpm install -g nof5\u003c/code\u003e\n\n## Options\n\nUsage: nof5 [options]\n\n    -h, --help            output usage information\n    -V, --version         output the version number\n    -d, --debug           outputs some additional debug output, such as a list of watched folders\n    -s, --silent          run without console logging\n    --list                lists all bundler names\n    -p, --port \u003cn\u003e        server port. Default: 11234\n    -t, --test \u003cdir\u003e      path to test folder. Default: process.cwd()\n    -l, --lib \u003cdir\u003e       path to lib folder\n    -a, --assets \u003cdir\u003e    path to folder where additionally files should be also served as statics\n    -b, --bundler \u003cname\u003e  defines the bundler which should be used. Default: 'Webpack'\n    -H, --hooks \u003cfile\u003e    path to file with hooks\n    -W, --wphooks \u003cfile\u003e  path to file with hooks for webpack-bundler\n    -B, --bhooks \u003cfile\u003e   path to file with hooks for browserify-bundler\n    -x, --xunit \u003cdir\u003e     path to store xunit.xml file.\n    -c, --clients \u003cfile\u003e  use given client hook\n\n## How to use\n\n### start nof5\n\nJust execute on command line from test's root folder \u003ccode\u003enof5\u003c/code\u003e or from anywhere \u003ccode\u003enof5 -t path/to/test/folder\u003c/code\u003e\n\n### hooks\n\n#### define general hooks (optional)\n\nDefine a file named \u003ccode\u003enof5.hooks.js\u003c/code\u003e under test's root folder or pass the path to the hooks-file \u003ccode\u003e nof5 -H path/to/hooks/file\u003c/code\u003e\n\nThe hooks-file should look like this:\n\n```javascript\n\n    exports.before = function beforeHook() {\n       //will be executed once\n    }\n\n    exports.beforeEach = function() {\n       //will be executed each time\n    }\n\n```\n\n#### define webpack hooks (optional)\n\nDefine a file named \u003ccode\u003enof5.webpack.hooks.js\u003c/code\u003e under test's root folder or or pass the path to the webpack-hooks-file \u003ccode\u003e nof5 -W path/to/webpack/hooks/file\u003c/code\u003e\n\nThe webpack-hooks.file should look like this:\n\n```javascript\n\n    exports.use = function () {\n\n        return {\n            // webpack-options @see https://github.com/webpack/webpack#options\n        };\n\n    }\n\n```\n\n#### define browserify hooks (optional)\n\nDefine a file named \u003ccode\u003enof5.browserify.hooks.js\u003c/code\u003e under test's root folder or or pass the path to the browserify-hooks-file \u003ccode\u003e nof5 -B path/to/browserify/hooks/file\u003c/code\u003e\n\nThe webpack-hooks.file should look like this:\n\n```javascript\n\n    exports.use = function () {\n\n        \"middlewareA\": function () {\n            //@see https://github.com/substack/node-browserify/blob/master/doc/methods.markdown#busefn\n        },\n\n        \"middlewareB\": function () {\n            // ...\n        }\n    }\n\n```\n\n\n### Create a Test-Runner\n\nAll files under root-folder are served as static files by nof5, so you can use any assets you like, e.g. jQuery, QUnit or Mocha.\n\n```html\n\n     \u003c!-- include socket.io to notify the client that a change on files has occured --\u003e\n     \u003cscript type=\"text/javascript\" src=\"/socket.io/socket.io.js\"\u003e\u003c/script\u003e\n\n     \u003c!-- include nof5 which will create a socket and configure it --\u003e\n     \u003cscript type=\"text/javascript\" src=\"/nof5.js\"\u003e\u003c/script\u003e\n\n     \u003c!-- load the tests. NOTE: You must execute the tests manually with nof5.enableTests()--\u003e\n     \u003cscript type=\"text/javascript\" src=\"tests.js\"\u003e\u003c/script\u003e\n\n     \u003cscript\u003e//configure your test-runner\u003c/script\u003e\n\n     \u003cscript\u003enof5.enableTests()\u003c/script\u003e\n\n\n```\n\nSee also the example implementation of a [Test-Runner](https://github.com/peerigon/nof5/blob/master/example/webpack/assets/testRunner.js).\n\n### Use with Jenkins\n\n TODO","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeerigon%2Fnof5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeerigon%2Fnof5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeerigon%2Fnof5/lists"}