{"id":15106985,"url":"https://github.com/normandy72/testing-http","last_synced_at":"2026-02-14T19:01:22.990Z","repository":{"id":153902844,"uuid":"593581788","full_name":"Normandy72/Testing-http","owner":"Normandy72","description":"Testing AngularJS Services and $http. Coursera course \"Single Page Web Applications with AngularJS\" by Yaakov Chaikin.","archived":false,"fork":false,"pushed_at":"2023-01-26T11:44:07.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-25T01:45:23.709Z","etag":null,"topics":["angular","angularjs","html","html5","jasmine","jasmine-tests","javascript","js","testing"],"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-26T11:19:06.000Z","updated_at":"2023-01-26T11:44:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"12125340-3abf-441c-8c98-8141b7d343b8","html_url":"https://github.com/Normandy72/Testing-http","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"bca6bec6997bb72b44de230b5f053bc39b13ecaa"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Normandy72/Testing-http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FTesting-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FTesting-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FTesting-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FTesting-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Normandy72","download_url":"https://codeload.github.com/Normandy72/Testing-http/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FTesting-http/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29452586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["angular","angularjs","html","html5","jasmine","jasmine-tests","javascript","js","testing"],"created_at":"2024-09-25T21:03:41.915Z","updated_at":"2026-02-14T19:01:22.970Z","avatar_url":"https://github.com/Normandy72.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Testing AngularJS Services and $http\n### beforeEach Setup\n```\nvar myService;\nvar $httpBackend;\n\nbeforeEach(function(){\n    module('MyApp');\n\n    inject(function($injector){\n        myService = $injector.get('MyService');\n        $httpBackend = $injector.get('$httpBackend');\n    });\n});\n```\n`$injector` - inject the regular Angular $injector to retrieve service.\n\n### Test Method\n```\nit(\"should return some data\", function(){\n    // simulate HTTP GET\n    $httpBackend.whenGet('http://...')\n        .respond(['val1', 'val2']);\n\n    myService.getItems().then(function(response){\n        expect(response.data).toEqual(['val1', [val2]]);\n    });\n\n    $httpBackend.flush();\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnormandy72%2Ftesting-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnormandy72%2Ftesting-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnormandy72%2Ftesting-http/lists"}