-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find name 'describe' #8909
Comments
Could you provide a reproduction git repo we could clone? Seems like your tsconfig might be missing types. |
Hi Hans This is my tsconfig: { For git repo, I should publish my entire production project... Is my tsconfig enough for the moment? thanks |
is there any other info I can give to you, maybe other configuration files or similar? thanks |
import {} from 'jasmine'; add above line to testing file 'xx.spec.ts' this will save you time.. |
Hi webdoors |
import {} from 'jasmine'; in the test file, like what you are trying to test, like appComponent.spec.ts |
Thanks Webdoors. This fixed the problem. I put it in file app.e2e-spec.ts |
@Webdoors |
for typescript > 2 just do a
|
Is there a more proper solution to this other than the I have documented my issue on Stack Overflow |
@strommj I don't know if this helps you but I encountered the same problem (typescript service claims there is no 'describe', 'beforeeach' etc even after I checked the @types). |
I installed an older version of jasmine with this command: |
@meysamsahragard, in my case I re-installed @types/jasmine@2.8.7 (the version that I already had) and re-started to work. I had tried clearing the cache before this but for some reason that wasn't enough... it was until I re-ran the install --save when finally worked. We had the problem in two different development machines and solved the same way. |
Thanks @meysamsahragard , did npm install --save-dev @types/jasmine@2.5.41 and it worked |
Hi @GeoffMahugu. I'm glad that your problem has been resolved. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Angular CLI: 1.6.1
Node: 8.2.1
OS: win32 x64
Angular: 5.0.0
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic, router
@angular/cdk: 2.0.0-beta.8
@angular/cli: 1.6.1
@angular/language-service: 4.3.2
@angular/material: 2.0.0-beta.8
@angular/platform-server: 5.1.1
@angular-devkit/build-optimizer: 0.0.36
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.42
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.1
@schematics/angular: 0.1.11
@schematics/schematics: 0.0.11
typescript: 2.4.2
webpack: 3.8.1
Repro steps
Follow guide:
https://github.com/angular/angular-cli/wiki/stories-universal-rendering
Observed behavior
I run;
npm run build:ssr && npm run serve:ssr
dist/browser and dist/server are created, server.js is created but when command:
webpack --config webpack.server.config.js --progress --colors
is executed, then i get this error:
ERROR in D:\Test\trunk-angular5-universal\e2e\app.e2e-spec.ts[tsl] ERROR in D:\Test\trunk-angular5-universal\e2e\app.e2e-spec.ts(3,1) TS2304: Cannot find name 'describe'.
ERROR in D:\Test\trunk-angular5-universal\e2e\app.e2e-spec.ts[tsl] ERROR in D:\Test\trunk-angular5-universal\e2e\app.e2e-spec.ts(6,3) TS2304: Cannot find name 'beforeEach'.
ERROR in D:\Test\trunk-angular5-universal\e2e\app.e2e-spec.ts[tsl] ERROR in D:\Test\trunk-angular5-universal\e2e\app.e2e-spec.ts(10,3) TS2304: Cannot find name 'it'.
ERROR in D:\Test\trunk-angular5-universal\e2e\app.e2e-spec.ts[tsl] ERROR in D:\Test\trunk-angular5-universal\e2e\app.e2e-spec.ts(12,5) TS2304: Cannot find name 'expect'.
Desired behavior
No error
Mention any other details that might be useful (optional)
My package.json:
{
"name": "XXX",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"build:ssr": "npm run build:client-and-server-bundles && npm run webpack:server",
"serve:ssr": "node dist/server.js",
"build:client-and-server-bundles": "ng build --prod && ng build --prod --app 1 --output-hashing=false",
"webpack:server": "webpack --config webpack.server.config.js --progress --colors"
},
"private": true,
"dependencies": {
"@agm/core": "1.0.0-beta.2",
"@agm/js-marker-clusterer": "1.0.0-beta.1",
"@angular/animations": "5.0.0",
"@angular/cdk": "2.0.0-beta.8",
"@angular/common": "5.0.0",
"@angular/compiler": "5.0.0",
"@angular/core": "5.0.0",
"@angular/forms": "5.0.0",
"@angular/http": "5.0.0",
"@angular/material": "2.0.0-beta.8",
"@angular/platform-browser": "5.0.0",
"@angular/platform-browser-dynamic": "5.0.0",
"@angular/platform-server": "5.1.1",
"@angular/router": "5.0.0",
"@covalent/core": "1.0.0-beta.5-1",
"@nguniversal/module-map-ngfactory-loader": "5.0.0-beta.5",
"@satispay/web-button-factory": "1.0.4",
"@types/angular": "1.6.28",
"@types/node": "6.0.88",
"braintree-web": "3.22.2",
"braintree-web-drop-in": "1.8.0",
"classlist.js": "1.1.20150312",
"core-js": "2.4.1",
"enhanced-resolve": "3.3.0",
"hammerjs": "2.0.8",
"js-marker-clusterer": "1.0.0",
"lory.js": "2.3.3",
"md5": "2.2.1",
"moment": "2.18.1",
"ng2-cookies": "1.0.12",
"ng2-responsive": "0.8.4",
"ng2-scroll-to-el": "1.0.0",
"paypal-checkout": "4.0.133",
"rxjs": "5.5.2",
"sass-loader": "6.0.6",
"ts-loader": "3.2.0",
"web-animations-js": "2.3.1",
"zone.js": "0.8.16"
},
"devDependencies": {
"@angular/cli": "1.6.1",
"@angular/compiler-cli": "5.0.0",
"@angular/language-service": "4.3.2",
"@types/jasmine": "2.5.45",
"@types/node": "6.0.88",
"codelyzer": "3.0.1",
"jasmine-core": "2.6.4",
"jasmine-spec-reporter": "4.1.1",
"karma": "1.7.0",
"karma-chrome-launcher": "2.1.1",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.3.0",
"karma-jasmine": "1.1.0",
"karma-jasmine-html-reporter": "0.2.2",
"ngx-swiper-wrapper": "5.1.0",
"protractor": "5.1.2",
"ts-node": "3.0.6",
"tslint": "5.3.2",
"typescript": "2.4.2",
"webpack": "3.8.1"
}
}
The text was updated successfully, but these errors were encountered: