I am using Angular2 (2.1.0) final release.
I was importing all components via AppModule when unit testing using ...
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [AppModule],
...
However, this made test runs slow.
I am now listing only the components I need as follows ...
beforeEach(async(() => {
// noinspection JSUnusedGlobalSymbols
TestBed.configureTestingModule({
imports: [BrowserModule, FormsModule, HttpModule], // modules
declarations: [
// pipes
AttributeCheckPipe,
// directives
// DatePickerDirective,
...
However, I have lots and lots of components and I am not sure which ones to import. The test output does not tell me which ones I need to import. It just simply passes (when I import them all) or fails (if I don't) but it doesn't tell me which ones are needed.
The error is an annoying / useless ..
invokeTask@node_modules/zone.js/dist/zone.min.js:1:36996
onInvokeTask@node_modules/zone.js/dist/proxy.min.js:1:2190
invokeTask@node_modules/zone.js/dist/zone.min.js:1:36939
runTask@node_modules/zone.js/dist/zone.min.js:1:31466
a@node_modules/zone.js/dist/zone.min.js:1:17818
g@node_modules/core-js/client/shim.min.js:8:19058
node_modules/core-js/client/shim.min.js:8:19180
k@node_modules/core-js/client/shim.min.js:8:14294
l@node_modules/zone.js/dist/zone.min.js:1:18418
l@node_modules/zone.js/dist/zone.min.js:1:18175
node_modules/zone.js/dist/zone.min.js:1:18715
How do I get feedback about which components I failed to import? thx
I am using Karma and PhantomJS.
My Karma config excerpt is ..
client: {
captureConsole: true
},
logLevel: config.LOG_DEBUG