Cannot find name 'describe' or any jasmine globals

See original GitHub issue

capture du 2016-10-28 13-15-41

here is my tsconfig.json file:


{
  "compilerOptions": {
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": ["es6", "dom"],
    "mapRoot": "./",
    "module": "es6",
    "moduleResolution": "node",
    "outDir": "../dist/out-tsc",
    "sourceMap": true,
    "target": "es5",
    "typeRoots": [
      "../node_modules/@types"
    ],
    "types": [
      "jasmine"
    ]
  }
}

the path to node_modules/@types is correct

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:16
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
Shijircommented, Jan 18, 2017

Using include instead of exclude is working for me:

{
    "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "moduleResolution": "node",
        "sourceMap": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "removeComments": false,
        "noImplicitAny": false,
        "typeRoots": [
            "node_modules/@types"
        ],
        "types": [
            "jasmine",
            "node",
            "core-js",
            "selenium-webdriver"
        ]
    },
    "include": [
        "src/**/*.ts",
        "node_modules/@types"
    ],
    "atom": {
        "rewriteTsconfig": false
    }
}
5reactions
ksharifbdcommented, Nov 11, 2016

I’ve answered similar issue on SO. May be you will find it helpful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 2 Unit Tests: Cannot find name 'describe'
Our editor and the compiler may complain that they don't know what it and expect are because they lack the typing files that...
Read more >
Jasmine - Cannot find name describe (or beforeEach, expect ...
With Angular 4, types are handled in package.json via the @types namespace. ... Jasmine – Cannot find name describe (or beforeEach, expect and...
Read more >
[SOLVED] Cannot Find Name describe in TypeScript
To fix the “cannot find name 'describe'” error, install the type definitions for your testing framework, and then add the definitions to the ......
Read more >
Globals
describe.each allows you to write the test suite once and pass data in. describe.each is available with two APIs: 1. describe.each(table)(name, ...
Read more >
cannot find name 'describe'. do you need to install type ...
Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found