{"id":18053980,"url":"https://github.com/danielstern/angular-tdd-exemplar","last_synced_at":"2025-04-10T22:53:26.935Z","repository":{"id":32131271,"uuid":"35703913","full_name":"danielstern/angular-tdd-exemplar","owner":"danielstern","description":"angular TDD sample project","archived":false,"fork":false,"pushed_at":"2015-06-22T16:38:27.000Z","size":590,"stargazers_count":18,"open_issues_count":1,"forks_count":22,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T22:53:21.933Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/danielstern.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-05-16T00:54:35.000Z","updated_at":"2023-11-30T19:26:59.000Z","dependencies_parsed_at":"2022-09-12T01:01:43.304Z","dependency_job_id":null,"html_url":"https://github.com/danielstern/angular-tdd-exemplar","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/danielstern%2Fangular-tdd-exemplar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielstern%2Fangular-tdd-exemplar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielstern%2Fangular-tdd-exemplar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielstern%2Fangular-tdd-exemplar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielstern","download_url":"https://codeload.github.com/danielstern/angular-tdd-exemplar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312172,"owners_count":21082638,"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-10-31T00:08:43.357Z","updated_at":"2025-04-10T22:53:26.913Z","avatar_url":"https://github.com/danielstern.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Angular TDD Examplar\n## Introduction\n\nThis Angular TDD is an example of Angular App build with running tests in mind.\n\nYou can clone this repository and use it as a basis for your app, or use it to learn about Test Driven Development with Angular.\n\n## Usage\n\n1. Clone or unzip the Git repository to your workstation.\n2. Install dependencies with npm install; bower install;\n3. Install Karma dependencies globally with `npm install -g karma karma-cli karma-protractor karma-coverage istanbul webdriver-manager mocha`\n4. Run the application using the instructions in the Gulp seciton.\n\n### Directory Structure\n\n```\n   /app/ \t\t\t\t\t\t\t\t\t\t\t\t// where our app is\n\t --/scripts/  \t\t\t\t\t\t\t\t// location of our app logic\n\t --/index.html\n \t/test/ \t\t\t\t\t\t\t\t\t\t\t\t// tests files\n\t --/coverage/\t\t\t\t\t\t\t\t\t// generated folder by istanbul\n\t --/e2e/ \t\t\t\t\t\t\t\t\t\t\t// end to end tests\n\t --/spec/ \t\t\t\t\t\t\t\t\t\t// unit tests for app\n\t --/protractor.config.js/  \t\t// set up for protractor\n\t --/server.spec.js/   \t\t\t\t// server unit tests\n\t/karma.conf.js\t\t\t\t\t\t\t\t// karma setup\n```\n\n### Gup Tasks Helper\n#### Run tests and serve\nTo run tests and then serve if the tests pass, run `gulp` (default task)\n\n#### Generate and Serve Code Coverage Metrics\nTo generate and then view your code coverage report, run `gulp coverage`\n\n#### To Serve and debug tests\nTests can be debugged in the browser by serving them with `gulp serve-test`\n\n#### To run end-to-end tests with protractor\nTo automatically run Selenium and run your e2e tests, run `gulp protractor`\n\n#### To run automated browser tests with Karma\nTo run all unit tests in every configured browser, run `gulp test-browser`\n\n#### To run all tests one after the other\nTo run each tests suite without them conflicting, run `gulp test`\n\n#### To test the Express server\nTo test the express server, run `gulp test-server`\n\n#### To serve the app\nTo serve the app, run `gulp serve` (also runs tests)\n\n\n## Glossary\n\n### Jasmine\n\u003e DOM-less simple JavaScript testing framework\nA test runner/assertion/mocking utility combination.\nUse: Run tests, write assertions and mock functionality.\nCompare To: Mocha+Chai\n\n### Mocha\nJust a test runner. Often used in combination with an assertion library (see Assert, Chai)\nCompare to: Jasmine\n\n### Karma\n\u003e The main goal for Karma is to bring a productive testing environment to developers. The environment being one where they don't have to set up loads of configurations, but rather a place where developers can just write the code and get instant feedback from their tests.\n\nKarma is a browser test runner.\n\nThe idea is that browsers do not have natively a concept of loading tests files, running them, and reporting results. What karma does is (roughly):\n\n- Start a small web server to serve \"client-side\" javascript files to be tested (1)\n- Also serve the \"client-side\" javascript files with the tests (or Specs, as they're often called) (2)\n-serve a custom web page that will run javascript code for the tests (3)\n- Start a browser to load this page (4)\n- Report the results of the test to the server (5)\n- Karma can then again report the results to text files, the console, anything your CI server likes, etc...\n\nUse: Karma can be used to run your tests in browsers. If your tests are simple JavaScript that would run the same in Node as in Chrome, this is not necessary, but if you wish to support Firefox, Chrome, IE, et al, in your tests, Karma lets you do it, via a configuration file.\nCompare To: N/A\n\n### Gulp\nUse: Automate tasks.\nEnvironment: Command Line / JavaScript\nCompare to: Grunt, Broccoli\n\n### gulp-karma\nUse: Simplify automation of running Karma in Gulp\nEnvironment: `require` this library in a gulpfile\nCompare to: gulp-jasmine\n\n### Supertest\nA framework specifically for running tests on servers created by Express or similar APIs.\nUse: Require supertest in your test script and have it run tests on your Server script\nCompare to: Request.js\n\n### Istanbul\nA tool for measuring how much of your code has tests covering it.\nUse: \nCompare to: N/A\n\n### angular\nMVC Framework.\nUse: Build single-page apps or augment static apps\nCompare to: Ember, React \n\n### angular-mocks\nA library necessary to run tests on your angular app. Has an e2e version that can only be run on the backend. \nUse: Include the script on your page to gain access to `inject` and `module`\nCompare to: N/A\n\n### protractor\nA library for running end-to-end tests on angular apps. protractor uses selenium/webdriver, which are two big words.\nUse: Test high level functionality like database interaction and navigation\n\n### Chai\nAssertion framework. Allows assertions to be written in `expect.to.be` form. Adds additional assertions to `assert` library.\nUse: Write assertions in a descriptive way\nCompare to: assert\n\n### assert\nA library built in to Node that can run certain assertions. \nUse: Use to write tests that can throw errors if code returns unexpected results.\nCompare to: Chai","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielstern%2Fangular-tdd-exemplar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielstern%2Fangular-tdd-exemplar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielstern%2Fangular-tdd-exemplar/lists"}