{"id":13432124,"url":"https://github.com/mantoni/choo-test","last_synced_at":"2025-08-23T10:36:55.488Z","repository":{"id":37686666,"uuid":"63532875","full_name":"mantoni/choo-test","owner":"mantoni","description":"🚂🚋🚋🚋 Easy choo app unit testing","archived":false,"fork":false,"pushed_at":"2023-04-17T08:43:09.000Z","size":834,"stargazers_count":23,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-19T03:51:57.085Z","etag":null,"topics":["choo","testing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mantoni.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-07-17T13:19:37.000Z","updated_at":"2022-02-02T08:08:46.000Z","dependencies_parsed_at":"2024-01-14T06:23:50.052Z","dependency_job_id":"6ba7aae5-abef-404b-a4eb-37c2564d82ae","html_url":"https://github.com/mantoni/choo-test","commit_stats":{"total_commits":53,"total_committers":3,"mean_commits":"17.666666666666668","dds":"0.24528301886792447","last_synced_commit":"aa9d678e874ba0c81fe46c9afc7e964eda8a5a7b"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/mantoni/choo-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mantoni%2Fchoo-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mantoni%2Fchoo-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mantoni%2Fchoo-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mantoni%2Fchoo-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mantoni","download_url":"https://codeload.github.com/mantoni/choo-test/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mantoni%2Fchoo-test/sbom","scorecard":{"id":615713,"data":{"date":"2025-08-11","repo":{"name":"github.com/mantoni/choo-test","commit":"aa9d678e874ba0c81fe46c9afc7e964eda8a5a7b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 1/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"28 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-2v5f-23xc-v9qr","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T03:52:23.646Z","repository_id":37686666,"created_at":"2025-08-21T03:52:23.646Z","updated_at":"2025-08-21T03:52:23.646Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271746660,"owners_count":24813575,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["choo","testing"],"created_at":"2024-07-31T02:01:08.781Z","updated_at":"2025-08-23T10:36:55.472Z","avatar_url":"https://github.com/mantoni.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# Choo Test\n\n[![SemVer]](http://semver.org)\n[![License]](https://github.com/mantoni/choo-test/blob/master/LICENSE)\n\nEasy [Choo][] testing for Choo v5, v6 and v7.\n\n## Install\n\n```bash\n$ npm install choo-test --save-dev\n```\n\n## Usage\n\nHere is an example using [Mochify][] as the test runner:\n\n```js\nvar assert = require('assert');\nvar choo = require('choo');\nvar html = require('choo/html');\nvar test = require('choo-test');\n\nfunction model(state, emitter) {\n  state.text = 'Test';\n\n  emitter.on('change', () =\u003e {\n    state.text = 'Changed';\n    emitter.emit('render');\n  });\n}\n\nfunction view(state, emit) {\n  return html`\u003cbutton onclick=${function () {\n    emit('change');\n  }}\u003e${state.text}\u003c/button\u003e`;\n  \n}\n\ndescribe('choo-app', function () {\n  var restore;\n  var app;\n\n  beforeEach(function () {\n    app = choo();\n    app.use(model);\n    app.route('/', view);\n  });\n\n  afterEach(function () {\n    restore();\n  });\n\n  it('changes the button text on click', function (done) {\n    restore = test.start(app);\n\n    test.fire('button', 'click');\n\n    test.onRender(function () {\n      assert.equal(test.$('button').innerText, 'Changed');\n      done();\n    });\n  });\n\n});\n```\n\n## How does it work?\n\nThis module is a collection of helper functions. Each of them can be used\nseparately.\n\nWhen you use the `start` function to start your Choo app, it wraps and appends\nthe application to a `div` tag in the `document.body`. When calling the\nreturned `restore` function, the DOM node is removed again.\n\nThe `onRender` function creates a [MutationObserver][] and invokes the given\ncallback if any change in the DOM tree happens.\n\nGlobal window events are captured and unregistered when calling `restore()`.\n\n## API\n\n- `$(selector[, scope])`: Find a DOM element using `querySelector`. `scope`\n  must be a DOM node to search and defaults to `document`.\n- `$$(selector[, scope])`: Find all DOM element using `querySelectorAll`.\n  `scope` must be a DOM node to search and defaults to `document`.\n- `fire(selector, event[, args])`: Fire an event using [bean.fire][].\n- `onRender([nodeOrSelector, ]fn)`: Register a function to invoke after the\n  next DOM mutation occurred. If only a function is given, the entire\n  `document` is observed. If no mutation occurs within 1500 ms, a timeout error\n  is thrown.\n- `start(app)`: Creates a `div` tag and append it to `document.body`, then\n  starts the given Choo app and attaches the returned tree to the `div` node.\n  Returns a `restore()` function which remove the `div` node from the body.\n\n## Testing XHR\n\nUse the [Sinon.js fake server][sinon-fake-server] for XHR testing. If you're\nusing the [xhr][] library, you have to initialize the `XMLHttpRequest`\nimplementation like this:\n\n```js\nsandbox = sinon.sandbox.create({\n  useFakeServer: true\n});\nsandbox.stub(xhr, 'XMLHttpRequest', sandbox.server.xhr);\n```\n\n## License\n\nMIT\n\n[SemVer]: http://img.shields.io/:semver-%E2%9C%93-brightgreen.svg\n[License]: http://img.shields.io/npm/l/choo-test.svg\n[Choo]: https://github.com/choojs/choo\n[Mochify]: https://github.com/mantoni/mochify.js\n[bean.fire]: https://github.com/fat/bean#fireelement-eventtype-args-\n[MutationObserver]: https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver\n[sinon-fake-server]: http://sinonjs.org/docs/#fakeServer\n[xhr]: https://www.npmjs.com/package/xhr\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmantoni%2Fchoo-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmantoni%2Fchoo-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmantoni%2Fchoo-test/lists"}