意外的令牌导入茉莉花

时间:2018-04-30 15:48:49

标签: angular typescript jasmine ionic3 angular2-routing

我有一个带角度2的离子项目。 我实际上是想用茉莉花来编写测试。但我总是有同样的问题。它不接受进口。

package.json
{
"version": "0.0.1",
"author": "Ionic Framework",
 "homepage": "http://ionicframework.com/",
 "private": true,
 "scripts": {
 "test": "jasmine-ts \"path/to/specs/**/*.spec.ts\""
 },
"dependencies": {
"@angular/common": "5.0.1",
"@angular/compiler": "5.0.1",
"@angular/compiler-cli": "5.0.1",
"@angular/core": "5.0.1",
"@angular/forms": "5.0.1",
"@angular/http": "5.0.1",
"@angular/platform-browser": "5.0.1",
"@angular/platform-browser-dynamic": "5.0.1",
"@ionic-native/core": "4.4.0",
"@ionic-native/splash-screen": "4.4.0",
"@ionic-native/status-bar": "4.4.0",
"@ionic/storage": "2.1.3",
"babel-cli": "^6.26.0",
"cordova-android": "^7.0.0",
"cordova-ios": "4.5.4",
"cordova-windows": "^5.0.0",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"moment": "^2.19.4",
"platform": "1.3.5",
"rxjs": "^5.5.5",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-device": "^2.0.1",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-ionic-webview": "^1.1.16",
"cordova-plugin-ionic-keyboard": "^2.0.5"
},
"devDependencies": {
 "@ionic/app-scripts": "3.1.2",
"@types/jasmine": "^2.8.6",
"@types/node": "^9.6.6",
"jasmine": "^3.1.0",
"jasmine-core": "^3.1.0",
"jasmine-spec-reporter": "^4.2.1",
"jasmine-ts": "^0.2.1",
"jasmine-ts-console-reporter": "^3.1.1",
"nodemon": "^1.17.3",
"ts-node": "^6.0.0",
"tslint": "^5.9.1",
"typescript": "^2.8.3"
 },
"description": "An Ionic project",
"cordova": {
 "plugins": {
  "cordova-plugin-whitelist": {},
  "cordova-plugin-device": {},
  "cordova-plugin-splashscreen": {},
  "cordova-plugin-ionic-webview": {},
  "cordova-plugin-ionic-keyboard": {}
   },
  "platforms": [
   "windows"
  ]
 }
}

test.spec.ts

  import { } from "jasmine";
 import { Datetest } from './datet'


 describe('test, () => {
 it('retourne 2', () => {
     expect(1 + 1).toBe(2);
  });

 });
describe('Datetest', () => {
 it('retourne le dernier jour du mois', () => {
    let dt= new Datetest ();
    let dernierDate = this.ft.getDernierJour(new 
    Date("01/05/2017"))
     expect(dernierDate).toBe(new Date("2017,06,0,0,0,0"));
   })
  })

错误:从“jasmine”导入{};   ^^^^^^  SyntaxError:意外的令牌导入     在createScript(vm.js:80:10)

我尝试了所有找到但仍有此错误的解决方案:意外的令牌导入。 有人可以帮帮我吗? 感谢。

0 个答案:

没有答案
相关问题