我想設置測試用例,這是我第一次使用袋鼠。小袋鼠沒有找到測試和@角/核心/測試沒有找到beforeEach,beforeEachProviders,describe等
在我的項目,我有一個spec.ts
,我想測試,但是遵循的是顯示我討厭的紅線下它:
import {beforeEach, beforeEachProviders, describe, expect, it, inject, } from '@angular/core/testing';
我用角CLI所以一切都應該建立和看起來正確。
路徑這個特殊的是src-> app-> home -> home.component.spec.ts
我試圖建立由做wallaby.js如下:
module.exports = function() {
return {
files: ['src/app/home/home.component.spec.ts'],
tests: ['src/app/**/*spec.ts'],
env: {
type: 'node',
runner: 'node',
params: {
runner: '--harmony'
}
},
testFramework: 'jest'
};
};
的package.json
{
"name": "demo-test-app",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"ng": "ng",
"start": "ng serve",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular/common": "^2.3.1",
"@angular/compiler": "^2.3.1",
"@angular/core": "^2.3.1",
"@angular/forms": "^2.3.1",
"@angular/http": "^2.3.1",
"@angular/platform-browser": "^2.3.1",
"@angular/platform-browser-dynamic": "^2.3.1",
"@angular/router": "^3.3.1",
"core-js": "^2.4.1",
"rxjs": "^5.0.1",
"ts-helpers": "^1.1.1",
"zone.js": "^0.7.2"
},
"devDependencies": {
"@angular/compiler-cli": "^2.3.1",
"@types/jasmine": "2.5.38",
"@types/node": "^6.0.42",
"angular-cli": "1.0.0-beta.24",
"codelyzer": "~2.0.0-beta.1",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "~4.0.13",
"ts-node": "1.2.1",
"tslint": "^4.0.2",
"typescript": "~2.0.3"
}
}
所以我完全無法運行測試並使用我發現的這個驚人的新工具。任何建議將不勝感激。
該項目是GitHub上HERE