antonybudianto / angular-webpack-starter

:star2: Angular Webpack Starter with AoT compilation, Lazy-loading, Tree-shaking, and Hot Module Reload (Updated to 4.1.0!)
http://angular-webpack-starter.surge.sh/
MIT License
90 stars 18 forks source link

E2E test with protractor broken #131

Closed Justus-Maier closed 7 years ago

Justus-Maier commented 7 years ago
## Issue Overview ``` [11:32:43] I/direct - Using ChromeDriver directly... [11:32:46] E/launcher - Error: C:\ody\angular-webpack-starter-master\e2e\home\home.spec.ts:1 (function (exports, require, module, __filename, __dirname) { import { browser, by, element } from 'protractor'; ^^^^^^ SyntaxError: Unexpected token import at Object.exports.runInThisContext (vm.js:73:16) at Module._compile (module.js:543:28) at Module.m._compile (C:\ody\angular-webpack-starter-master\node_modules\ts-node\src\index.ts:413:23) at Module._extensions..js (module.js:580:10) at Object.require.extensions.(anonymous function) [as .ts] (C:\ody\angular-webpack-starter-master\node_modules\ts-node\src\index.ts:416: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) [11:32:46] E/launcher - Process exited with error code 100 ``` ## Issue Description ts-node fails es6 imports for protractor e2e tests. What about testbundling for protractor? ## Reproducables simply clone and reinstall repo (yarn.lock) > yarn > npm start > npm run e2e ## Information | | | |--------------------- |--------------------------------- | | **Operating System** | Windows 7 x64 | | **Node version** | 7.5.0 | | **NPM Version** | 4.1.2 | | **Environment** | Chrome/Firefox |
antonybudianto commented 7 years ago

Thanks for the report, I'll investigate it

antonybudianto commented 7 years ago

@Justus-Maier , I've fixed it, please review it, thank you

Justus-Maier commented 7 years ago
1 spec, 0 failures
Finished in 1.616 seconds

It works, yes! Thanks for fixing it so quickly!!

Small question before you close this: If one wants to run the protractor tests against the production build, one has to change the protractor config to match production ports. Maybe the protractor config should also read environment config?

antonybudianto commented 7 years ago

It's possible too, you can install it easily by loading dotenv into protractor.conf.js

GhadeerHaddad commented 5 years ago

hey @antonybudianto , how did you fix it?

GhadeerHaddad commented 5 years ago

and I am facing same error but with export