{"id":17794695,"url":"https://github.com/burningdog/js-tdd","last_synced_at":"2026-04-27T22:32:41.692Z","repository":{"id":73034877,"uuid":"130496453","full_name":"BurningDog/js-tdd","owner":"BurningDog","description":"Test-driven development with Javascript","archived":false,"fork":false,"pushed_at":"2018-04-21T17:33:10.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T02:31:18.872Z","etag":null,"topics":["babel","babel-plugin-istanbul","istanbul","javascript","tape","tdd"],"latest_commit_sha":null,"homepage":null,"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/BurningDog.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-21T17:25:07.000Z","updated_at":"2018-04-21T17:35:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"75d79b10-da09-45fe-ac67-cabd8e9ec6de","html_url":"https://github.com/BurningDog/js-tdd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BurningDog/js-tdd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BurningDog%2Fjs-tdd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BurningDog%2Fjs-tdd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BurningDog%2Fjs-tdd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BurningDog%2Fjs-tdd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BurningDog","download_url":"https://codeload.github.com/BurningDog/js-tdd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BurningDog%2Fjs-tdd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32358509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["babel","babel-plugin-istanbul","istanbul","javascript","tape","tdd"],"created_at":"2024-10-27T11:18:20.330Z","updated_at":"2026-04-27T22:32:41.674Z","avatar_url":"https://github.com/BurningDog.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is my TDD setup for Javascript. It's based on the lessons at https://github.com/dwyl/learn-tdd\n\nIt uses tape as a light unit testing framework to test functions in Javascript ES6 modules.\nSee https://medium.com/javascript-scene/why-i-use-tape-instead-of-mocha-so-should-you-6aa105d8eaf4\n\n## Installation\n\nClone the repo and install the dependendies:\n\n```\n$ yarn\n```\n\n## Usage\n\n### Run tests\n\n```\n$ yarn test\n```\n\n### Watch for changes and run tests each time a file changes\n\n```\n$ yarn run watch\n```\n\n(Note: I had mixed results with using yarn when there were errors in the tests; if using yarn inside the `watch` script\nthen the error output looked far worse than npm's output. So I'm using npm there instead. YMMV.)\n\n### Generate a code coverage report\n\n```\n$ yarn run coverage\n```\n\nNote the last part of the console output:\n\n```\n--------------------|----------|----------|----------|----------|-------------------|\nFile                |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |\n--------------------|----------|----------|----------|----------|-------------------|\nAll files           |    80.95 |    83.33 |      100 |       85 |                   |\n vending-machine.js |    80.95 |    83.33 |      100 |       85 |          17,18,19 |\n--------------------|----------|----------|----------|----------|-------------------|\n```\n\nOpen up `coverage/lcov-report/index.html` in a browser and click on the js file there. It'll show what code specifically\nisn't covered.\n\n### JSDoc\n\n```\n$ yarn run jsdoc\n```\n\nThen open `out/index.html` and click on `getChange` at the top right. It'll show the output of the documented\ngetChange() function.\n\n## Additions\n\nThere were a few extra things I wanted to get working which weren't covered by dwyl.\n\n### ES6 modules\n\nWhile the dwyl link focusses on writing pre-ES6 Javascript I wanted to use ES6 style modules (`exports` keyword).\nInstead of using `require` to import modules I wanted the newer `import`.\n\nOne way to do this is using babel, as per [@_ericelliot](https://twitter.com/@_ericelliot). Note the `.babelrc` file which has the `es2015` preset -\nthis specifically allows for ES6 functionality.\n\n### Istanbul with ES6\n\nThe Istanbul code coverage examples all work fine with vanilla javascript, but fail with ES6. \n[NYC](https://github.com/istanbuljs/nyc) is the command line interface to Istanbul. It allows for ES6 usage\nby using babel-register.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fburningdog%2Fjs-tdd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fburningdog%2Fjs-tdd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fburningdog%2Fjs-tdd/lists"}