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 wallabyTest.ts bootstrap file to the project.
- Exclude the
src/wallabyTest.ts
file in thetsconfig.json
as it may affect Angular AOT compilation. - Run
npm install wallaby-webpack angular2-template-loader --save-dev
.
Note that the sample is using Chrome (headless) runner.
Alternatively, you may use Electron test runner. In this case you may change the env
setting to env: {kind: 'electron'}
, and run npm i electron --save-dev
.
You may use PhantomJs runner if you like, to do that you may remove the env
setting. In this case, you will not need to npm i electron
(and can remove electron
from the package.json
dependencies), however will need to uncomment core-js polyfills and Intl
polyfill, so that PhantomJs may work.
If you are looking for a way to use wallaby.js with Jest for angular-cli
generated project, then you may find the working config in this docs section.