Angular-cli: Error : ng e2e

Created on 26 May 2017  Â·  3Comments  Â·  Source: angular/angular-cli

After create a new fresh project, I got error when running ng e2e

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / â–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.0.6
node: 7.10.0
os: darwin x64
@angular/common: 4.1.3
@angular/compiler: 4.1.3
@angular/core: 4.1.3
@angular/forms: 4.1.3
@angular/http: 4.1.3
@angular/platform-browser: 4.1.3
@angular/platform-browser-dynamic: 4.1.3
@angular/router: 4.1.3
@angular/cli: 1.0.6
@angular/compiler-cli: 4.1.3

Repro steps.

ng e2e

The log given by the failure.

** NG Live Development Server is listening on localhost:49152, open your browser on http://localhost:49152 **
Hash: a81e1086c1a891e2cfd7
Time: 12368ms
chunk    {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 158 kB {4} [initial] [rendered]
chunk    {1} main.bundle.js, main.bundle.js.map (main) 3.63 kB {3} [initial] [rendered]
chunk    {2} styles.bundle.js, styles.bundle.js.map (styles) 10.5 kB {4} [initial] [rendered]
chunk    {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.4 MB [initial] [rendered]
chunk    {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
webpack: Compiled successfully.
[10:40:43] I/update - chromedriver: file exists /Volumes/MacHD/Users/wildan/Myproject/PhpstormProjects/rereq/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.29.zip
[10:40:43] I/update - chromedriver: unzipping chromedriver_2.29.zip
[10:40:43] I/update - chromedriver: setting permissions to 0755 for /Volumes/MacHD/Users/wildan/Myproject/PhpstormProjects/rereq/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.29
[10:40:43] I/update - chromedriver: chromedriver_2.29 up to date
[10:40:45] I/launcher - Running 1 instances of WebDriver
[10:40:45] I/direct - Using ChromeDriver directly...
[10:40:48] E/launcher - Error: TSError: ⨯ Unable to compile TypeScript
e2e/app.e2e-spec.ts (12,45): Argument of type '"app works!"' is not assignable to parameter of type 'Expected<Promise<string>>'. (2345)
    at getOutput (/Volumes/MacHD/Users/wildan/Myproject/PhpstormProjects/rereq/node_modules/ts-node/src/index.ts:302:15)
    at /Volumes/MacHD/Users/wildan/Myproject/PhpstormProjects/rereq/node_modules/ts-node/src/index.ts:333:16
    at Object.compile (/Volumes/MacHD/Users/wildan/Myproject/PhpstormProjects/rereq/node_modules/ts-node/src/index.ts:492:17)
    at Module.m._compile (/Volumes/MacHD/Users/wildan/Myproject/PhpstormProjects/rereq/node_modules/ts-node/src/index.ts:385:43)
    at Module._extensions..js (module.js:580:10)
    at Object.require.extensions.(anonymous function) [as .ts] (/Volumes/MacHD/Users/wildan/Myproject/PhpstormProjects/rereq/node_modules/ts-node/src/index.ts:388:12)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at /Volumes/MacHD/Users/wildan/Myproject/PhpstormProjects/rereq/node_modules/jasmine/lib/jasmine.js:93:5
    at Array.forEach (native)
    at Jasmine.loadSpecs (/Volumes/MacHD/Users/wildan/Myproject/PhpstormProjects/rereq/node_modules/jasmine/lib/jasmine.js:92:18)
    at Jasmine.execute (/Volumes/MacHD/Users/wildan/Myproject/PhpstormProjects/rereq/node_modules/jasmine/lib/jasmine.js:197:8)
    at /Volumes/MacHD/Users/wildan/Myproject/PhpstormProjects/rereq/node_modules/protractor/built/frameworks/jasmine.js:132:15
[10:40:48] E/launcher - Process exited with error code 100

Desired functionality.

  rereq App
    ✓ should display message saying app works

Mention any other details that might be useful.

(node:1963) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.     

Most helpful comment

Upgrade Jasmine to version 2.5.45
or
Other version , include newer version of jasmine
Solved by modified e2e/app.e2e-spec.ts :
```
expect(page.getParagraphText()).toEqual('app works!');
````

All 3 comments

Upgrade Jasmine to version 2.5.45
or
Other version , include newer version of jasmine
Solved by modified e2e/app.e2e-spec.ts :
```
expect(page.getParagraphText()).toEqual('app works!');
````

The proper solution for a project running Angular 6 or 7 would be to add "jasminewd2" in your tsconfig.e2e.json like so:

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/e2e",
    "module": "commonjs",
    "target": "es5",
    "types": [
      "jasmine",
      "jasminewd2",   // THIS HERE 
      "node"
    ]
  }
}

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings