Closed jimmymain closed 5 years ago
@jimmymain, if you are using jasmine 3.x
, it is duplicate with #1015. It have been fixed and will be released in next version.
you can see https://github.com/angular/zone.js/issues/1015#issuecomment-368939131 to find a temp solution.
Could you provide a reproduce repo?
On Wed, Feb 28, 2018 at 2:53 PM, Jim notifications@github.com wrote:
I am using jasmine 2.0.0, the latest release version
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/angular/zone.js/issues/1035#issuecomment-369130533, or mute the thread https://github.com/notifications/unsubscribe-auth/ABYDD9O5Ly4extXcIrlvfqe5jOltGaj7ks5tZOn3gaJpZM4SWGuy .
I don't know if it's related to zone but here is a repo
https://github.com/jimmykane/quantified-self
Mine same problem
@jimmymain , you could try to update your package.json
to
"zone.js": "git://github.com/JiaLiPassion/zone.js#jasmine-dist"
and run npm install
and try again.
Hey @JiaLiPassion thanks for the reply. That seems to fix the problem, however I get some errors again when running the tests.
But keep in mind I am just gettting started with angular testing so it might be my mistake.
I am pasting the output here just in case it is usefull
16 03 2018 11:47:56.651:INFO [Chrome 65.0.3325 (Mac OS X 10.13.3)]: Connected on socket wkwuI_oI-_UswkDKAAAA with id 4136108
Chrome 65.0.3325 (Mac OS X 10.13.3): Executed 0 of 2 SUCCESS (0 secs / 0 secs)
Chrome 65.0.3325 (Mac OS X 10.13.3) AppComponent should create the app FAILED
1. If 'app-sidenav' is an Angular component, then verify that it is part of this module.
2. If 'app-sidenav' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<mat-sidenav #sidenav mode="push">
[ERROR ->]<app-sidenav></app-sidenav>
</mat-sidenav>
1. If 'mat-sidenav' is an Angular component, then verify that it is part of this module.
2. If 'mat-sidenav' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("<mat-sidenav-container class="mat-typography">
[ERROR ->]<mat-sidenav #sidenav mode="push">
<app-sidenav></app-sidenav>
</mat-sidenav>
error properties: Object({ ngSyntaxError: true, ngParseErrors: [ 'app-sidenav' is not a known element:
"): ng:///DynamicTestModule/AppComponent.html@3:4, 'mat-sidenav' is not a known element:
"): ng:///DynamicTestModule/AppComponent.html@2:2, 'mat-icon' is not a known element:
1. If 'mat-icon' is an ...
Error: Template parse errors:
at <Jasmine>
at syntaxError node_modules/@angular/compiler/esm5/compiler.js:485:22)
at TemplateParser.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.TemplateParser.parse node_modules/@angular/compiler/esm5/compiler.js:24668:1)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._parseTemplate node_modules/@angular/compiler/esm5/compiler.js:34621:1)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileTemplate node_modules/@angular/compiler/esm5/compiler.js:34596:1)
at http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/compiler/esm5/compiler.js:34497:48
at <Jasmine>
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileComponents node_modules/@angular/compiler/esm5/compiler.js:34497:1)
at http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/compiler/esm5/compiler.js:34385:1
at Object.then node_modules/@angular/compiler/esm5/compiler.js:474:33)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileModuleAndAllComponents node_modules/@angular/compiler/esm5/compiler.js:34383:1)
1. If 'app-sidenav' is an Angular component, then verify that it is part of this module.
2. If 'app-sidenav' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<mat-sidenav #sidenav mode="push">
[ERROR ->]<app-sidenav></app-sidenav>
</mat-sidenav>
1. If 'mat-sidenav' is an Angular component, then verify that it is part of this module.
2. If 'mat-sidenav' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("<mat-sidenav-container class="mat-typography">
[ERROR ->]<mat-sidenav #sidenav mode="push">
<app-sidenav></app-sidenav>
</mat-sidenav>
error properties: Object({ ngSyntaxError: true, ngParseErrors: [ 'app-sidenav' is not a known element:
"): ng:///DynamicTestModule/AppComponent.html@3:4, 'mat-sidenav' is not a known element:
"): ng:///DynamicTestModule/AppComponent.html@2:2, 'mat-icon' is not a known element:
1. If 'mat-icon' is an ...
Error: Template parse errors:
at <Jasmine>
at syntaxError node_modules/@angular/compiler/esm5/compiler.js:485:22)
at TemplateParser.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.TemplateParser.parse node_modules/@angular/compiler/esm5/compiler.js:24668:1)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._parseTemplate node_modules/@angular/compiler/esm5/compiler.js:34621:1)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileTemplate node_modules/@angular/compiler/esm5/compiler.js:34596:1)
at http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/compiler/esm5/compiler.js:34497:48
at <Jasmine>
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileComponents node_modules/@angular/compiler/esm5/compiler.js:34497:1)
at http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/compiler/esm5/compiler.js:34385:1
at Object.then node_modules/@angular/compiler/esm5/compiler.js:474:33)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileModuleAndAllComponents node_modules/@angular/compiler/esm5/compiler.js:34383:1)
Chrome 65.0.3325 (Mac OS X 10.13.3): Executed 1 of 2 (1 FAILED) (0 secs / 0 secs)
Chrome 65.0.3325 (Mac OS X 10.13.3) AppComponent should create the app FAILED
1. If 'app-sidenav' is an Angular component, then verify that it is part of this module.
2. If 'app-sidenav' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<mat-sidenav #sidenav mode="push">
[ERROR ->]<app-sidenav></app-sidenav>
</mat-sidenav>
1. If 'mat-sidenav' is an Angular component, then verify that it is part of this module.
2. If 'mat-sidenav' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("<mat-sidenav-container class="mat-typography">
[ERROR ->]<mat-sidenav #sidenav mode="push">
<app-sidenav></app-sidenav>
</mat-sidenav>
error properties: Object({ ngSyntaxError: true, ngParseErrors: [ 'app-sidenav' is not a known element:
"): ng:///DynamicTestModule/AppComponent.html@3:4, 'mat-sidenav' is not a known element:
"): ng:///DynamicTestModule/AppComponent.html@2:2, 'mat-icon' is not a known element:
1. If 'mat-icon' is an ...
Error: Template parse errors:
at <Jasmine>
at syntaxError node_modules/@angular/compiler/esm5/compiler.js:485:22)
at TemplateParser.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.TemplateParser.parse node_modules/@angular/compiler/esm5/compiler.js:24668:1)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._parseTemplate node_modules/@angular/compiler/esm5/compiler.js:34621:1)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileTemplate node_modules/@angular/compiler/esm5/compiler.js:34596:1)
at http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/compiler/esm5/compiler.js:34497:48
at <Jasmine>
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileComponents node_modules/@angular/compiler/esm5/compiler.js:34497:1)
at http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/compiler/esm5/compiler.js:34385:1
at Object.then node_modules/@angular/compiler/esm5/compiler.js:474:33)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileModuleAndAllComponents node_modules/@angular/compiler/esm5/compiler.js:34383:1)
1. If 'app-sidenav' is an Angular component, then verify that it is part of this module.
2. If 'app-sidenav' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<mat-sidenav #sidenav mode="push">
[ERROR ->]<app-sidenav></app-sidenav>
</mat-sidenav>
1. If 'mat-sidenav' is an Angular component, then verify that it is part of this module.
2. If 'mat-sidenav' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("<mat-sidenav-container class="mat-typography">
[ERROR ->]<mat-sidenav #sidenav mode="push">
<app-sidenav></app-sidenav>
</mat-sidenav>
error properties: Object({ ngSyntaxError: true, ngParseErrors: [ 'app-sidenav' is not a known element:
"): ng:///DynamicTestModule/AppComponent.html@3:4, 'mat-sidenav' is not a known element:
"): ng:///DynamicTestModule/AppComponent.html@2:2, 'mat-icon' is not a known element:
1. If 'mat-icon' is an ...
Error: Template parse errors:
at <Jasmine>
at syntaxError node_modules/@angular/compiler/esm5/compiler.js:485:22)
at TemplateParser.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.TemplateParser.parse node_modules/@angular/compiler/esm5/compiler.js:24668:1)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._parseTemplate node_modules/@angular/compiler/esm5/compiler.js:34621:1)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileTemplate node_modules/@angular/compiler/esm5/compiler.js:34596:1)
at http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/compiler/esm5/compiler.js:34497:48
at <Jasmine>
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileComponents node_modules/@angular/compiler/esm5/compiler.js:34497:1)
at http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/compiler/esm5/compiler.js:34385:1
at Object.then node_modules/@angular/compiler/esm5/compiler.js:474:33)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileModuleAndAllComponents node_modules/@angular/compiler/esm5/compiler.js:34383:1)
Chrome 65.0.3325 (Mac OS X 10.13.3) UploadInfoComponent should create FAILED
1. If 'mat-progress-bar' is an Angular component, then verify that it is part of this module.
2. If 'mat-progress-bar' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
</li>
</ul>
[ERROR ->]<mat-progress-bar mode="indeterminate"></mat-progress-bar>
error properties: Object({ ngSyntaxError: true, ngParseErrors: [ 'mat-progress-bar' is not a known element:
</div>"): ng:///DynamicTestModule/UploadInfoComponent.html@11:2 ] })
Error: Template parse errors:
at <Jasmine>
at syntaxError node_modules/@angular/compiler/esm5/compiler.js:485:22)
at TemplateParser.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.TemplateParser.parse node_modules/@angular/compiler/esm5/compiler.js:24668:1)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._parseTemplate node_modules/@angular/compiler/esm5/compiler.js:34621:1)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileTemplate node_modules/@angular/compiler/esm5/compiler.js:34596:1)
at http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/compiler/esm5/compiler.js:34497:48
at <Jasmine>
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileComponents node_modules/@angular/compiler/esm5/compiler.js:34497:1)
at http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/compiler/esm5/compiler.js:34385:1
at Object.then node_modules/@angular/compiler/esm5/compiler.js:474:33)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileModuleAndAllComponents node_modules/@angular/compiler/esm5/compiler.js:34383:1)
1. If 'mat-progress-bar' is an Angular component, then verify that it is part of this module.
2. If 'mat-progress-bar' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
</li>
</ul>
[ERROR ->]<mat-progress-bar mode="indeterminate"></mat-progress-bar>
Error: Template parse errors:
error properties: Object({ ngSyntaxError: true, ngParseErrors: [ 'mat-progress-bar' is not a known element:
</div>"): ng:///DynamicTestModule/UploadInfoComponent.html@11:2 ] })
at <Jasmine>
at syntaxError node_modules/@angular/compiler/esm5/compiler.js:485:22)
at TemplateParser.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.TemplateParser.parse node_modules/@angular/compiler/esm5/compiler.js:24668:1)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._parseTemplate node_modules/@angular/compiler/esm5/compiler.js:34621:1)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileTemplate node_modules/@angular/compiler/esm5/compiler.js:34596:1)
at http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/compiler/esm5/compiler.js:34497:48
at <Jasmine>
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileComponents node_modules/@angular/compiler/esm5/compiler.js:34497:1)
at http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/compiler/esm5/compiler.js:34385:1
at Object.then node_modules/@angular/compiler/esm5/compiler.js:474:33)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileModuleAndAllComponents node_modules/@angular/compiler/esm5/compiler.js:34383:1)
Expected undefined to be truthy.
at <Jasmine>
at UserContext.<anonymous> src/app/components/upload-info/upload-info.component.spec.ts:23:23)
at ZoneDelegate.webpackJsonp../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke node_modules/zone.js/dist/zone.js:388:1)
at ProxyZoneSpec.webpackJsonp../node_modules/zone.js/dist/proxy.js.ProxyZoneSpec.onInvoke node_modules/zone.js/dist/proxy.js:79:1)
at ZoneDelegate.webpackJsonp../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke node_modules/zone.js/dist/zone.js:387:1)
Chrome 65.0.3325 (Mac OS X 10.13.3): Executed 2 of 2 (2 FAILED) (0 secs / 0 secs)
Chrome 65.0.3325 (Mac OS X 10.13.3) UploadInfoComponent should create FAILED
1. If 'mat-progress-bar' is an Angular component, then verify that it is part of this module.
2. If 'mat-progress-bar' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
</li>
</ul>
[ERROR ->]<mat-progress-bar mode="indeterminate"></mat-progress-bar>
error properties: Object({ ngSyntaxError: true, ngParseErrors: [ 'mat-progress-bar' is not a known element:
</div>"): ng:///DynamicTestModule/UploadInfoComponent.html@11:2 ] })
Error: Template parse errors:
at <Jasmine>
at syntaxError node_modules/@angular/compiler/esm5/compiler.js:485:22)
at TemplateParser.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.TemplateParser.parse node_modules/@angular/compiler/esm5/compiler.js:24668:1)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._parseTemplate node_modules/@angular/compiler/esm5/compiler.js:34621:1)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileTemplate node_modules/@angular/compiler/esm5/compiler.js:34596:1)
at http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/compiler/esm5/compiler.js:34497:48
at <Jasmine>
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileComponents node_modules/@angular/compiler/esm5/compiler.js:34497:1)
at http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/compiler/esm5/compiler.js:34385:1
at Object.then node_modules/@angular/compiler/esm5/compiler.js:474:33)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileModuleAndAllComponents node_modules/@angular/compiler/esm5/compiler.js:34383:1)
1. If 'mat-progress-bar' is an Angular component, then verify that it is part of this module.
2. If 'mat-progress-bar' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
</li>
</ul>
[ERROR ->]<mat-progress-bar mode="indeterminate"></mat-progress-bar>
Error: Template parse errors:
error properties: Object({ ngSyntaxError: true, ngParseErrors: [ 'mat-progress-bar' is not a known element:
</div>"): ng:///DynamicTestModule/UploadInfoComponent.html@11:2 ] })
at <Jasmine>
at syntaxError node_modules/@angular/compiler/esm5/compiler.js:485:22)
at TemplateParser.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.TemplateParser.parse node_modules/@angular/compiler/esm5/compiler.js:24668:1)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._parseTemplate node_modules/@angular/compiler/esm5/compiler.js:34621:1)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileTemplate node_modules/@angular/compiler/esm5/compiler.js:34596:1)
at http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/compiler/esm5/compiler.js:34497:48
at <Jasmine>
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileComponents node_modules/@angular/compiler/esm5/compiler.js:34497:1)
at http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/compiler/esm5/compiler.js:34385:1
at Object.then node_modules/@angular/compiler/esm5/compiler.js:474:33)
at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileModuleAndAllComponents node_modules/@angular/compiler/esm5/compiler.js:34383:1)
Expected undefined to be truthy.
at <Jasmine>
at UserContext.<anonymous> src/app/components/upload-info/upload-info.component.spec.ts:23:23)
at ZoneDelegate.webpackJsonp../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke node_modules/zone.js/dist/zone.js:388:1)
at ProxyZoneSpec.webpackJsonp../node_modules/zone.js/dist/proxy.js.ProxyZoneSpec.onInvoke node_modules/zone.js/dist/proxy.js:79:1)
at ZoneDelegate.webpackJsonp../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke node_modules/zone.js/dist/zone.js:387:1)
Chrome 65.0.3325 (Mac OS X 10.13.3): Executed 2 of 2 (2 FAILED) ERROR (0.144 secs / 0 secs)
@jimmykane , the error you posted is not zone.js
issue, it seems you didn't compile or load your component correctly, you can ask it at stackoverflow.
@JiaLiPassion as I imagined. Told you I am new to this. However indeed your suggestion fixed my first issue.
Should I keep that entry in my package json or how should I proceed with the issue releated to zone.js?
Thank you by the way for the effort!
@jimmykane , you can keep the entry if you want to use jasmine 3.x or you can downgrade your jasmine to 2.x.
I have logged a question for this, but I think it's possibly a bug.
testProxyZone
is null in the function below.TypeError: Cannot read property 'run' of null
all the packages are updated to the latest release versionThe testProxyZone is null even though my
base.spec.js
contains the necessary imports.the test contains the necessary import / setup
and the configuration references the necessary libraries?