2016-09-12 10 views
2

ここCannot find name 'describe'活字体2つのジャスミンタイプ

は私のspecファイルであることを私は活字体2を使用していると私は私のスペックファイルの先頭に/// <reference path="..." />を入れない限り、私はエラーを取得する:

/// <reference path="../../../../node_modules/@types/jasmine/index.d.ts" /> 

import { DashboardSlotComponent } from './dashboard-slot.component'; 
import { DashboardSlot } from './dashboard-slot.model'; 

describe('Given a dashboard slot component',() => { 
    let sut: DashboardSlotComponent; 

    beforeEach(() => { 
     sut = new DashboardSlotComponent(); 
    }); 
... 

package.json

"typescript": "2.0.2", 

tsconfig.json

{ 
    "compilerOptions": { 
    "target": "es5", 
    "module": "commonjs", 
    "moduleResolution": "node", 
    "emitDecoratorMetadata": true, 
    "experimentalDecorators": true, 
    "allowSyntheticDefaultImports": true, 
    "sourceMap": true, 
    "noEmitHelpers": true, 
    "strictNullChecks": false, 
    "baseUrl": "./src", 
    "paths": [ 
    ], 
    "lib": [ 
     "dom", 
     "es6" 
    ], 
    "types": [ 
     "angular", 
     "hammerjs", 
     "jasmine", 
     "node", 
     "selenium-webdriver", 
     "source-map", 
     "uglify-js", 
     "webpack" 
    ] 
    }, 
    "exclude": [ 
    "dist", 
    "node_modules" 
    ], 
    "awesomeTypescriptLoaderOptions": { 
    "forkChecker": true, 
    "useWebpackText": true 
    }, 
    "compileOnSave": false, 
    "buildOnSave": false, 
    "atom": { "rewriteTsconfig": false } 
} 

私はTypescript 2拡張機能を備えたVisual Studio 2015を使用しています。活字体2と

enter image description here

+0

@インストールNPMことを確認しましたか?建てる時?もしそうなら、あなたのビルドプロセスは何ですか? – cartant

+0

ビルドはwebpackを使用してエラーなしで正常に動作します。ジャスミンを認識できないような視覚的なスタジオです。リファレンスを1つのファイルの先頭に置くと、すべてのスペックファイルが見つかりますジャスミンの種類..非常に奇妙な行動 –

答えて

1

、試してみてください。

/// <reference types="jasmine" /> 

、あなたがエラーを参照してくださいかの種類/ジャスミン