ngx-zombie-compiler
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

ngx-zombie-compiler

wercker status npm version dependencies Status Greenkeeper badge GitHub license

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

Readme

Keywords

Package Sidebar

Install

npm i ngx-zombie-compiler

Weekly Downloads

5

Version

0.3.0

License

MIT

Last publish

Collaborators

  • quramy