You have learned about jsdom and AVA independently and have done some simple tests. Now, we can bring these two packages together into our Nuxt apps. Let's install them in our Nuxt app, which you created in the previous chapter, in /chapter-12/nuxt-universal/cross-domain/jwt/axios-module/frontend/ using the following steps:
- Install these two tools via npm and save them to the devDependencies option in the package.json file:
$ npm i ava --save-dev
$ npm i jsdom --save-dev
- Install Babel core and other Babel packages for us to write ES6 code in our tests in the app:
$ npm i @babel/polyfill
$ npm i @babel/core --save-dev
$ npm i @babel/preset-env --save-dev
$ npm i @babel/register --save-dev
- Add the AVA configuration to the package.json file as follows:
// package.json
{
"scripts": {
"test": "ava --verbose",
"test:watch": "ava --watch"
},
"ava": {
"require"...