https://github.com/hudson-newey/ng-jasmine-async-wrapper
A simple wrapper for async functions in Angular + Jasmine
https://github.com/hudson-newey/ng-jasmine-async-wrapper
angular jasmine jasmine-framework jasmine-tests test testing testing-tools unit-testing
Last synced: about 1 month ago
JSON representation
A simple wrapper for async functions in Angular + Jasmine
- Host: GitHub
- URL: https://github.com/hudson-newey/ng-jasmine-async-wrapper
- Owner: hudson-newey
- License: unlicense
- Created: 2023-06-22T13:27:47.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-22T13:44:56.000Z (almost 2 years ago)
- Last Synced: 2025-04-04T05:31:06.751Z (about 1 month ago)
- Topics: angular, jasmine, jasmine-framework, jasmine-tests, test, testing, testing-tools, unit-testing
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@hudson-newey/ng-jasmine-async-wrapper
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ngx-[Jasmine](https://github.com/jasmine/jasmine) async wrapper
A wrapper for async functions in Angular + Jasmine tests
## Usage
```ts
it("should create", asyncTest(() => {
expect(component).toBeInstanceOf(App);
}));
```## Why?
Because
1. Jasmine throws an error if there are still async tasks waiting
2. Discarding async tasks must be done explicitly as they have to be discarded in the same async zone as they were created (we can't use `afterEach`)