{"id":19901367,"url":"https://github.com/lissy93/quick-example-of-testing-in-nodejs","last_synced_at":"2025-05-02T23:31:47.600Z","repository":{"id":8111975,"uuid":"41312109","full_name":"Lissy93/quick-example-of-testing-in-nodejs","owner":"Lissy93","description":"🛡 An example TDD project in Node.js, with unit tests, coverage tests, a stubbed API, continuous integration, code quality reviews and automated dependency checking","archived":false,"fork":false,"pushed_at":"2024-02-22T07:05:19.000Z","size":18,"stargazers_count":23,"open_issues_count":2,"forks_count":77,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T21:37:02.297Z","etag":null,"topics":["assertions","behavior-driven-development","code-quality","continuous-integration","coverage-testing","dependency-manager","istanbul","mocha","stubbing","test-driven-development","unit-testing"],"latest_commit_sha":null,"homepage":"https://goo.gl/YCdqoj","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/Lissy93.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":"2015-08-24T15:48:08.000Z","updated_at":"2024-04-09T21:23:34.000Z","dependencies_parsed_at":"2023-02-19T01:15:18.530Z","dependency_job_id":null,"html_url":"https://github.com/Lissy93/quick-example-of-testing-in-nodejs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lissy93%2Fquick-example-of-testing-in-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lissy93%2Fquick-example-of-testing-in-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lissy93%2Fquick-example-of-testing-in-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lissy93%2Fquick-example-of-testing-in-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lissy93","download_url":"https://codeload.github.com/Lissy93/quick-example-of-testing-in-nodejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224341306,"owners_count":17295272,"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":["assertions","behavior-driven-development","code-quality","continuous-integration","coverage-testing","dependency-manager","istanbul","mocha","stubbing","test-driven-development","unit-testing"],"created_at":"2024-11-12T20:14:49.341Z","updated_at":"2024-11-12T20:14:49.500Z","avatar_url":"https://github.com/Lissy93.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003ch1 align=\"center\"\u003e🛠️ Unit Testing in Node.JS\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  \u003ci\u003eA quick example of testing in Node.JS\u003c/i\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#\"\u003e\n   \u003cimg src=\"https://api.travis-ci.org/Lissy93/quick-example-of-testing-in-nodejs.svg\" alt=\"Travis\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://snyk.io/test/github/Lissy93/quick-example-of-testing-in-nodejs\"\u003e\n    \u003cimg src=\"https://snyk.io/test/github/Lissy93/quick-example-of-testing-in-nodejs/badge.svg\" alt=\"Known Vulnerabilities\"\u003e\n  \u003c/a\u003e\n    \u003ca href=\"#\"\u003e\n    \u003cimg src=\"http://inch-ci.org/github/Lissy93/quick-example-of-testing-in-nodejs.svg?branch=master\" alt=\"Docs Rank\"\u003e\n  \u003c/a\u003e\n    \u003ca href=\"https://www.codacy.com/gh/Lissy93/quick-example-of-testing-in-nodejs/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=Lissy93/quick-example-of-testing-in-nodejs\"\u003e\n    \u003cimg src=\"https://app.codacy.com/project/badge/Grade/3f14d24ffafe4200a643f4aba34fc2f3\" alt=\"Code Quality\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n## Intro\nThis is a quick example project to show how a test environment can be setup in Node.js\n\nIt includes the following\n\n- [Mocha](http://mochajs.org/) - *testing framework*\n- [Chai](http://chaijs.com/) - *assertion library*\n- [Istanbul](https://github.com/gotwarlost/istanbul) - *coverage testing*\n- [SinonJs](http://sinonjs.org/) - *stubs and splices for mocking data*\n\n\nThe following online tools are used to monitor results\n\n- [Travis CI](https://travis-ci.org/) - *Continuous Integration*\n- [David DM](https://david-dm.org/) - *Dependency Management*\n- [Codacy](https://www.codacy.com/) - *Automated Code Quality Reviews*\n- [Inch CI](https://inch-ci.org/) - *Documentation Reviews*\n\n---\n\n## The Project\nThe project is a very simple script that pulls current weather data from OpenWeatherMap\nfor your location, it then analyses it and lists which items (umbrella, icecream, jumper...)\nyou will need for the current weather.\n\n\n### Installation\n- Navigate into your working directory, run the following commands:\n- ```git clone https://github.com/Lissy93/quick-example-of-testing-in-nodejs.git``` to clone repo\n- ```cd quick-example-of-testing-in-nodejs``` to navigate into project\n- ```npm install``` to install the dependencies\n\n### Running\n- ```npm start``` will run the main file (app.js) and display results\n- ```node app --location Newcastle``` will run app.js for a custom location, e.g. Newcastle\n- ```npm test``` will run the Mocha tests, output results and generate reports\n- ```npm run cover``` will run the Istanbul coverage tests and output results and generate reports\n\n---\n\n## Screenshots\n\n\u003cp align=\"center\"\u003e\n\u003ci\u003eCommand Line Output: Tests Passing\u003c/i\u003e\u003cbr\u003e\n\u003cimg src=\"https://i.ibb.co/WDpBStz/better-test3.png\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ci\u003eWeb Report: Some Tests Failing\u003c/i\u003e\u003cbr\u003e\n\u003cimg src=\"https://i.ibb.co/93CdGjG/bad-test1.png\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ci\u003eWeb Report: All Tests Passing\u003c/i\u003e\u003cbr\u003e\n\u003cimg src=\"https://i.ibb.co/nCdHFs4/better-test2.png\" /\u003e\n\u003c/p\u003e\n\n---\n\n\u003cp  align=\"center\"\u003e\n  \u003ci\u003e© \u003ca href=\"https://aliciasykes.com\"\u003eAlicia Sykes\u003c/a\u003e 2011 - 2017\u003c/i\u003e\u003cbr\u003e\n  \u003ci\u003eLicensed under \u003ca href=\"https://gist.github.com/Lissy93/143d2ee01ccc5c052a17\"\u003eMIT\u003c/a\u003e\u003c/i\u003e\u003cbr\u003e\n  \u003ca href=\"https://github.com/lissy93\"\u003e\u003cimg src=\"https://i.ibb.co/4KtpYxb/octocat-clean-mini.png\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flissy93%2Fquick-example-of-testing-in-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flissy93%2Fquick-example-of-testing-in-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flissy93%2Fquick-example-of-testing-in-nodejs/lists"}