1

我在我的项目中安装了茉莉花的类型。这些现在位于我的“index.d.ts”文件中。但是,在编写测试时expect('').toBeNaN,我只会显示“toBe”,仅此而已。

这些是我的配置文件:

tsconfig.json

    {
      "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true
      },
      "filesGlob": [
        "**/*.ts",
        "!node_modules/**/*"
      ],
      "include": [
        "typings/index.d.ts"
      ],
      "exclude": [
        "node_modules",
        "typings/main",
        "typings/main.d.ts"
      ],
      "compileOnSave": false,
      "atom": {
        "rewriteTsconfig": false
      }
    }

这是我的index.d.ts

/// <reference path="globals/jasmine-expect/index.d.ts" />
/// <reference path="globals/jasmine/index.d.ts" />
/// <reference path="globals/karma-jasmine/index.d.ts" />
4

1 回答 1

0

您可能安装了错误的版本。尝试从类型中安装以下内容。

typings install dt~jasmine --global --save-dev

在撰写本文时,它安装了 2.2.0 版。

于 2016-08-16T00:07:22.497 回答