After installing Vue Testing Library (by doing npm install --save-dev @testing-library/vue
) I tried to run the example test by doing:
npm run test:unit
Straight away I'm getting this error:
'vue-cli-service' is not recognized as an internal or external command, operable program or batch file.
Tried npm i
to no avail.
Any idea what's going on?
EDIT: jest.config.js
module.exports = {
preset: '@vue/cli-plugin-unit-jest/presets/no-babel'
}
package.json
{
"version": "1.0.0",
"private": true,
"scripts": {
"build": "nuxt build",
"test:unit": "vue-cli-service test:unit",
"lint": "npm run lint:js",
"dev": "nuxt",
"generate": "nuxt generate",
"lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
"start": "nuxt start"
},
"dependencies": {
"@nuxtjs/axios": "^5.12.5",
"core-js": "^3.8.3",
"nuxt": "^2.14.12",
"nuxt-lazy-load": "^1.2.5",
"vue-lottie": "^0.2.1",
"vue-ripple-directive": "^2.0.1"
},
"devDependencies": {
"@nuxtjs/eslint-config": "^5.0.0",
"@nuxtjs/eslint-module": "^3.0.2",
"@nuxtjs/router": "^1.5.1",
"@nuxtjs/style-resources": "^1.0.0",
"@nuxtjs/svg": "^0.1.12",
"@nuxtjs/tailwindcss": "^3.4.2",
"@tailwindcss/postcss7-compat": "^2.0.3",
"@testing-library/vue": "^5.6.1",
"autoprefixer": "^9.8.6",
"babel-eslint": "^10.1.0",
"eslint": "^7.18.0",
"eslint-plugin-nuxt": "^2.0.0",
"eslint-plugin-vue": "^7.5.0",
"node-sass": "^5.0.0",
"postcss": "^7.0.35",
"sass-loader": "^10.1.1",
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.3"
}
}