lundi 14 décembre 2020

Error TS2305: Module @types/angular has no exported member 'cookies'

I am having an issue with cookies not being defined in angular scope.

npm run start builds and starts the app just fine, but when trying to run npm test that executes jest command, I am getting this error:

`Test suite failed to run app/components/Component1/Component1.ts:1:10

  • error TS2305: Module '"../../../../../node_modules/@types/angular"' has no exported member 'cookies'.`

in Component1.ts there is this import: import { cookies } from 'angular';

Build and run - ok. Testing - not ok.

If you know where the issue can be hidden, please help :) Thank you.

my package.json:

{
  "dependencies": {
    ...,
    "angular": "^1.8.0",
    "angular-cookies": "1.8.0",
    "babel-polyfill": "^6.2.0",
    ...
  },
  "devDependencies": {
    "@types/angular": "^1.8.0",
    "@types/angular-cookies": "^1.8.0",
    "@types/jest": "^26.0.19",
    "angular-mock": "^1.0.0",
    "angular-mocks": "^1.8.2",
    "angularjs-jest": "^0.1.4",
    "babel-core": "^6.24.1",
    "babel-loader": "^7.0.0",
    "jest": "^26.6.3",
    "ts-jest": "^26.4.4",
    ...
  }
}

Aucun commentaire:

Enregistrer un commentaire