To get wallaby.js working after you have generated your project with angular-cli
, you'll need to do the following:
- Add the wallaby.js config file to the project.
- Add the wallaby.js test bootstrap file to the project.
- Exclude the
src/wallabyTest.ts
file in thetsconfig.json
as it may affect Angular 2 AOT compilation. - Run
npm install wallaby-webpack angular2-template-loader electron --save-dev
.
Note that the sample is using Chrome/Electron test runner, and not the wallaby.js default PhantomJs test runner. You may use PhantomJs runner if you like, to do that you may just remove the env
setting. In this case, you will not need to npm i electron
, however will need to uncomment core-js polyfills and Intl
polyfill, so that PhantomJs may work.