https://github.com/quramy/ngx-zombie-compiler
Fast JiT compiler for Angular testing
https://github.com/quramy/ngx-zombie-compiler
angular karma test
Last synced: 6 months ago
JSON representation
Fast JiT compiler for Angular testing
- Host: GitHub
- URL: https://github.com/quramy/ngx-zombie-compiler
- Owner: Quramy
- License: mit
- Created: 2017-04-22T09:05:40.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-12T06:10:24.000Z (over 8 years ago)
- Last Synced: 2025-03-23T01:36:26.112Z (7 months ago)
- Topics: angular, karma, test
- Language: TypeScript
- Size: 81.1 KB
- Stars: 15
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ngx-zombie-compiler
[](https://app.wercker.com/project/byKey/5a0a95321e9f308a2e82388d339e4b16) [](https://badge.fury.io/js/ngx-zombie-compiler) [](https://david-dm.org/quramy/ngx-zombie-compiler) [](https://greenkeeper.io/) [](https://raw.githubusercontent.com/Quramy/ngx-zombie-compiler/master/LICENSE)Fast JiT compiler for Angular unit testing.
## Install
```sh
npm install ngx-zombie-compiler -D
```or
```sh
yarn add ngx-zombie-compiler -D
```## Usage
To use the compiler provided by this module, you need to configure it using `TestBed.configureCompiler`. If you use angular-cli, you can edit `src/test.ts`.
```typescript
// First, import ZOMBIE_COMPILER_PROVIDERS
import { ZOMBIE_COMPILER_PROVIDERS } from 'ngx-zombie-compiler';// :
// Second, configure TestBed's compiler
beforeEach(() => {
getTestBed().configureCompiler({
providers: ZOMBIE_COMPILER_PROVIDERS,
});
});
```## Why?
By the default, TestingCompiler provided by Angular compiles all modules by each spec and compiling modules makes your test heavy.
In mane cases, we can turn use the compiled result, so this module provide another JiT compiler which outlives default JiT compiler and reuses the compiled result. So using this, you can reduce the total execution time to run unit testing.If you want details, please see [my gist](https://gist.github.com/Quramy/1dd5bed0bce1e7f34b79184453d1790f#configure-testbeds-compiler).
## License
MIT