Registry / testing / ngx-zombie-compiler

ngx-zombie-compiler

JSON →
library0.3.0jsnpmunverified

Fast JiT compiler for Angular unit testing that reuses compiled results across specs to reduce execution time. Current stable version 0.3.0, compatible with Angular 4.2+. Unlike default Angular TestingCompiler which compiles modules per spec, this compiler outlives the default and caches compiled components. Ships TypeScript types. Low release cadence; last release in 2017. Useful for Angular CLI projects (edit src/test.ts). Few alternatives exist for this niche optimization.

npm install ngx-zombie-compiler
INSTALL
IMPORT
SIG · NGX-ZOMBIE-COMPILE
N
ngx-zombie-compiler
testingjavascriptv0.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ZOMBIE_COMPILER_PROVIDERS
import { ZOMBIE_COMPILER_PROVIDERS } from 'ngx-zombie-compiler';
const { ZOMBIE_COMPILER_PROVIDERS } = require('ngx-zombie-compiler');
Package provides ESM and CJS; default export is not available.
ZombieCompiler
import { ZombieCompiler } from 'ngx-zombie-compiler';
import ZombieCompiler from 'ngx-zombie-compiler';
Named export, not default.
ZombieJitCompiler
import { ZombieJitCompiler } from 'ngx-zombie-compiler';
Internal class not typically needed; use ZOMBIE_COMPILER_PROVIDERS.

Configures TestBed to use the zombie compiler, reusing compiled results across specs.

import { TestBed, getTestBed } from '@angular/core/testing'; import { ZOMBIE_COMPILER_PROVIDERS } from 'ngx-zombie-compiler'; beforeEach(() => { getTestBed().configureCompiler({ providers: ZOMBIE_COMPILER_PROVIDERS, }); }); // Then write your tests normally
Debug
Known issues
breakingVersion 0.3.0 requires Angular 4.2.0+ due to breaking change in JitCompiler constructor. Older versions incompatible.
fix
Upgrade to ngx-zombie-compiler@0.3.0 and ensure @angular/core and @angular/compiler are >=4.2.0.
affects: <0.3.0
deprecatedPackage has not been updated since Angular 4. May not work with Angular 5+ due to changes in compiler internals.
fix
Consider testing with Angular 5+; if compilation fails, look for alternatives or fork.
affects: >=0.3.0
gotchaZOMBIE_COMPILER_PROVIDERS must be provided in beforeEach(), not once at top level, to avoid cross-test contamination.
fix
Call getTestBed().configureCompiler({ providers: ZOMBIE_COMPILER_PROVIDERS }) inside each beforeEach() or in a setup function per test suite.
affects: all
gotchaDoes not support AOT compilation; only JiT. AOT tests may need jasmine or jest configuration.
fix
For AOT, use Angular's default TestBed or @angular/platform-browser-dynamic testing utilities.
affects: all
Errors
Common errors & fixes
Error: Can't resolve 'ngx-zombie-compiler'
Package not installed or typo in import path.
fix
npm install ngx-zombie-compiler --save-dev
TypeError: TestBed.configureCompiler is not a function
Using old Angular version where TestBed.configureCompiler does not exist.
fix
Ensure @angular/core is version 4.x.x or later. For Angular 2.x, use deprecated methods.
Error: StaticInjectorError[ZombieCompiler]: NullInjectorError: No provider for JitCompiler!
Missing @angular/compiler peer dependency.
fix
npm install @angular/compiler@^4.2.0
Upgrade
Version history
0.3.0latest on npm
Audit
Dependencies
@angular/corerequiredPeer dependency; provides TestBed and JitCompiler used internally.
@angular/compilerrequiredPeer dependency; provides JitCompiler base class.
Agent activity
2 hits · last 30 days
node
2
Resources
ngx-zombie-compiler — npm install ngx-zombie-compiler · libregistry