ngx-zombie-compiler
v0.3.0
Published
Fast JiT compiler for Angular testing
Downloads
28
Readme
ngx-zombie-compiler
Fast JiT compiler for Angular unit testing.
Install
npm install ngx-zombie-compiler -D
or
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
.
// 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.
License
MIT