vyakymenko / angular-seed-express

[DEPRECATED, Please use https://github.com/vyakymenko/angular-express] Extensible, reliable and modular starter project for Angular 7 with statically typed build AoT compilation, Express server and PM2 Daemon.

Home Page:https://github.com/vyakymenko/angular-seed-express

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"e2e" npm script does not spin up express server, while "e2e" gulp task does

sergiodias-veritas opened this issue · comments

I'm submitting a ...

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see use [gitter](https://gitter.im/mgechev/angular2-seed) or [stackoverflow](https://stackoverflow.com/questions/tagged/angular2)

Current behavior
When running the e2e npm script, the tests fail because the server isn't up. If I run the server in production mode with node app.server.prod.js at the same time, it does work. If I run the e2e gulp task instead, it does work.

Expected behavior
When running the e2e npm script, the tests pass because the server is up. The e2e gulp task spins up its own express server, as per defined in tools/tasks/seed/e2e.ts, so it should be expected that the e2e npm script does too.

An additional question: are we supposed to use the npm scripts, or the gulp tasks directly?

Minimal reproduction of the problem with instructions

  • Run npm run e2e
    The tests fail to run, because the express server isn't up.

What is the motivation / use case for changing the behavior?
Making it not necessary for the express server to be launched separately, since (apparently) that was the original intent.

Please tell us about your environment:
I'm using Ubuntu 16.10, npm 3.10.10 and node v6.10.3.

  • Angular Seed Version: aaaaf75
    I'm not sure how to get this information, but I cloned the project yesterday from the master branch.

  • Node: node --version = 6.10.3

Closed because I got a few things wrong.

Re-opened after fixing a few issues with the OP.

Hi @sergiodias-veritas , let's go step-by-step:

  1. $ npm run build.prod # or npm run build.prod.rollup.aot, after finish goto step 2.
  2. $ node app.server.prod.js
  3. $ npm run e2e.

If you want to test dev build, open protractor.conf.js and change your localhost port.

@vyakymenko Thanks for the instructions. After I created the issue, I had tried that, and it did work, but I still found it odd that the "e2e" gulp task spins up the full express server, but the "e2e" npm script does not, so I left the issue open. But if that is intended, we can close this issue.

@sergiodias-veritas , I've apologized, but for now, it's not implemented in the current version. I will keep in mind this enhancement.

@vyakymenko OK, thanks for the help.