{"id":15106987,"url":"https://github.com/normandy72/testing-with-jasmine","last_synced_at":"2026-01-19T21:34:06.472Z","repository":{"id":153902834,"uuid":"593197809","full_name":"Normandy72/Testing-With-Jasmine","owner":"Normandy72","description":"Testing Javascript with Jasmine. Coursera course \"Single Page Web Applications with AngularJS\" by Yaakov Chaikin.","archived":false,"fork":false,"pushed_at":"2023-01-25T14:32:55.000Z","size":83,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-11T09:42:51.980Z","etag":null,"topics":["angular","angularjs","css","css3","html","html5","jasmine","jasmine-tests","javascript","js","testing","unit-test"],"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/Normandy72.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-25T13:19:21.000Z","updated_at":"2023-01-26T09:43:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"4f317c70-3df2-4608-aea5-d8ae8c68d38a","html_url":"https://github.com/Normandy72/Testing-With-Jasmine","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"181b95edc2afa2577506219611c3db68fd1046e3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FTesting-With-Jasmine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FTesting-With-Jasmine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FTesting-With-Jasmine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FTesting-With-Jasmine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Normandy72","download_url":"https://codeload.github.com/Normandy72/Testing-With-Jasmine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345703,"owners_count":20924098,"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":["angular","angularjs","css","css3","html","html5","jasmine","jasmine-tests","javascript","js","testing","unit-test"],"created_at":"2024-09-25T21:03:43.157Z","updated_at":"2026-01-19T21:34:06.437Z","avatar_url":"https://github.com/Normandy72.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Testing Javascript with Jasmine\n### unit testing\nIndependent checking for proper operation of the smallest testable part of an application.\n* Independent: isolated from the rest of the system.\n* Smallest testable: means you have to approach the all of code development from this prospective.\n* Should be repeatable.\n\n### mocking\nTechnique where dependency and its behavior is imitated (or faked).\n* Can be done by the developer or a mocking library.\n### Steps for Jasmine-based Tests\n* Download and unzip Jasmine standalone into a directory.\n[https://github.com/jasmine/jasmine/releases]()\n* Erase everything in src and spec directories.\n* Place your application code into the src directory.\n* Place test code or a spec into the spec directory.\n* Update SpecRunner.thml\n    * Replace references to erased src and spec files with yours.\n* Start Browser-sync (or whatever you use for local server) and go to the `http://.../SpecRunner.html` to have your specs run.\n\n### Writing a Spec (test)\n```\ndescribe(\"My Function\", function(){\n    var initValue;\n\n    beforeEach(function(){\n        initValue = \"someVal\";\n    });\n\n    it(\"should not return true\", function(){\n        var result = someFunc(initValue);\n        expect(result).not.toBe(true);\n    });\n});\n```\n***\n#### _Summary_\n* Unit testing is an essential process in any software dev. Planning for unit testing changes how you write code (for the better).\n* Mocks are used to fake the dependencies of target code.\n* `describe(\"message\", function(){})` is to used to group tests together.\n* `beforeEach(function(){})` is used to initialize state before running each test.\n* `it(\"message\", function(){actual test})` is used to run the actual test code.\n***","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnormandy72%2Ftesting-with-jasmine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnormandy72%2Ftesting-with-jasmine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnormandy72%2Ftesting-with-jasmine/lists"}