错误:无法转移程序ionic2

时间:2017-09-27 18:45:15

标签: angular typescript ionic2

离子cordova构建android     [WARN]在package.json中检测到@ ionic / cli-plugin-ionic-angular。

       As of CLI 3.8, it is no longer needed. You can uninstall it:

       npm uninstall --save-dev --save-exact @ionic/cli-plugin-ionic-a

[INFO] Running app-scripts build: --platform android --target cordova

[15:38:32]  build dev started ...
[15:38:32]  clean started ...
[15:38:32]  clean finished in 1 ms
[15:38:32]  copy started ...
[15:38:32]  transpile started ...
[15:38:39]  typescript: C:/Users/NATALIA/Pictures/mdp365-ionic3/src/aponent.spec.ts, line: 6
            Cannot find name 'describe'.

       L5:  beforeEach(() => {
       L6:    TestBed.configureTestingModule({
       L7:      declarations: [

[15:38:39]  typescript: C:/Users/NATALIA/Pictures/mdp365-ionic3/src/aponent.spec.ts, line: 7
            Cannot find name 'beforeEach'.

       L6:  TestBed.configureTestingModule({
       L7:    declarations: [
       L8:      AppComponent

[15:38:39]  typescript: C:/Users/NATALIA/Pictures/mdp365-ionic3/src/aponent.spec.ts, line: 16
            Cannot find name 'it'.

      L15:  const fixture = TestBed.createComponent(AppComponent);
      L16:  const app = fixture.debugElement.componentInstance;
      L17:  expect(app).toBeTruthy();

[15:38:39]  typescript: C:/Users/NATALIA/Pictures/mdp365-ionic3/src/aponent.spec.ts, line: 19
            Cannot find name 'expect'.

      L18:    }));
      L20:    it(`should have as title 'app works!'`, async(() => {

[15:38:39]  typescript: C:/Users/NATALIA/Pictures/mdp365-ionic3/src/aponent.spec.ts, line: 22
            Cannot find name 'it'.

      L21:  const fixture = TestBed.createComponent(AppComponent);
      L22:  const app = fixture.debugElement.componentInstance;
      L23:  expect(app.title).toEqual('app works!');

[15:38:39]  typescript: C:/Users/NATALIA/Pictures/mdp365-ionic3/src/aponent.spec.ts, line: 25
            Cannot find name 'expect'.

      L24:    }));
      L26:    it('should render title in a h1 tag', async(() => {

[15:38:39]  typescript: C:/Users/NATALIA/Pictures/mdp365-ionic3/src/aponent.spec.ts, line: 28
            Cannot find name 'it'.

      L27:  const fixture = TestBed.createComponent(AppComponent);
      L28:  fixture.detectChanges();
      L29:  const compiled = fixture.debugElement.nativeElement;

[15:38:39]  typescript: C:/Users/NATALIA/Pictures/mdp365-ionic3/src/aponent.spec.ts, line: 32
            Cannot find name 'expect'.

      L31:    }));
      L32:  });

错误:无法转换程序         在BuildError.Error(本机)         在新的BuildError(C:\ Users \ NATALIA \ Pictures \ mdp365-ionic3 \ node_moic \ app-scripts \ dist \ util \ errors.js:16:28)         在C:\ Users \ NATALIA \ Pictures \ mdp365-ionic3 \ node_modules \ @ionic \ appist \ transpile.js:137:20         在transpileWorker(C:\ Users \ NATALIA \ Pictures \ mdp365-ionic3 \ node_mnic \ app-scripts \ dist \ transpile.js:103:12)         在Object.transpile(C:\ Users \ NATALIA \ Pictures \ mdp365-ionic3 \ node_onic \ app-scripts \ dist \ transpile.js:61:12)         在buildProject(C:\ Usersenter code here \ NATALIA \ Pictures \ mdp365-ionic3 \ node_modu \ app-scripts \ dist \ build.js:97:78)         在C:\ Users \ NATALIA \ Pictures \ mdp365-ionic3 \ node_modules \ @ionic \ appist \ build.js:47:16

1 个答案:

答案 0 :(得分:0)

所有缺少的成员看起来都与您的测试框架相关(我猜测它是Jasmine或Jest):

Cannot find name 'describe'.
...
Cannot find name 'it'.

您需要确保:

  1. 您有可用的框架(在package.json等)
  2. 已在您的spec文件中导入框架(导入/要求等)