{"id":18764476,"url":"https://github.com/theintern/angular-plugin","last_synced_at":"2026-07-03T16:04:01.277Z","repository":{"id":66243823,"uuid":"97734607","full_name":"theintern/angular-plugin","owner":"theintern","description":"Intern 4 plugin for testing Angular","archived":false,"fork":false,"pushed_at":"2017-09-12T14:37:08.000Z","size":41,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-20T20:15:10.961Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theintern.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":"2017-07-19T15:47:38.000Z","updated_at":"2020-06-18T12:52:53.000Z","dependencies_parsed_at":"2023-03-10T23:44:40.036Z","dependency_job_id":null,"html_url":"https://github.com/theintern/angular-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/theintern/angular-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theintern%2Fangular-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theintern%2Fangular-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theintern%2Fangular-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theintern%2Fangular-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theintern","download_url":"https://codeload.github.com/theintern/angular-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theintern%2Fangular-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35092210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-03T02:00:05.635Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-07T18:29:58.737Z","updated_at":"2026-07-03T16:04:01.253Z","avatar_url":"https://github.com/theintern.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @theintern/angular-plugin\n\nA plugin to set up the Angular testbed for use with Intern\n\n## Installation\n\n`@theintern/angular-plugin` should be installed as a peer of `intern`:\n\n```sh\nnpm install intern@next @theintern/angular-plugin\n```\n\n## Usage\n\nTo use `@theintern/angular-plugin`, simply add it to the `plugins` array of `intern.json`:\n\n```json\n{\n  \"browser\": {\n    ...\n\n    \"plugins\": [\n      \"@theintern/angular-plugin\"\n    ],\n\n    ...\n  }\n}\n```\n\nThe plugin does the following:\n\n* Ensures Zone.js is loaded with long stack trace support\n* Initializes Angular's `TestBed` for use in the browser\n* Resets the testing module of Angular's `TestBed` after each test\n\nIf a browser shim or other Zone.js patches are required, add them as plugins before and after `@theintern/angular-plugin`:\n\n```json\n{\n  \"browser\": {\n    ...\n\n    \"plugins\": [\n      \"core-js/client/shim.js\",\n      \"@theintern/angular-plugin\",\n      \"zone.js/dist/proxy.js\",\n      \"zone.js/dist/sync-test.js\",\n      \"zone.js/dist/async-test.js\",\n      \"zone.js/dist/fake-async-test.js\"\n    ],\n\n    ...\n  }\n}\n```\n\n*NOTE: Because of Intern's native support of asynchronous tests (and TypeScript's downlevel emit for async/await), there should be no need for the fake async patches to Zone.js.*\n\n## Writing unit tests\n\nWriting unit tests for Angular in Intern should look similar to writing unit tests for Angular in Karma, with one notable exception: there is no need for the fake async wrappers and async/await should be used instead:\n\n```ts\nconst { describe, it, beforeEach } = intern.getInterface('bdd');\nconst { expect } = intern.getPlugin('chai');\n\nimport { ComponentFixture, TestBed } from '@angular/core/testing';\nimport { MyComponent } from './MyComponent';\n\ndescribe('MyComponent', () =\u003e {\n    let comp: MyComponent;\n    let fixture: ComponentFixture\u003cMyComponent\u003e;\n\n    beforeEach(async () =\u003e {\n        await TestBed.configureTestingModule({\n            declarations: [\n                ...\n            ]\n        }).compileComponents();\n\n        fixture = TestBed.createComponent(MyComponent);\n        comp = fixture.componentInstance;\n\n        fixture.detectChanges();\n    });\n\n    it('is instantiated', () =\u003e {\n        expect(comp).not.to.be.null;\n    });\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheintern%2Fangular-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheintern%2Fangular-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheintern%2Fangular-plugin/lists"}