We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__tests__
3.10.0
https://github.com/reproducing/reproduce-eslint-tests
System: OS: macOS 10.14.5 CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz Binaries: Node: 12.6.0 - /usr/local/bin/node Yarn: 1.17.3 - /usr/local/bin/yarn npm: 6.9.0 - /usr/local/bin/npm Browsers: Chrome: 75.0.3770.142 Firefox: 67.0.4 Safari: 12.1.1 npmPackages: @vue/babel-helper-vue-jsx-merge-props: 1.0.0 @vue/babel-plugin-transform-vue-jsx: 1.0.0 @vue/babel-preset-app: 3.10.0 @vue/babel-preset-jsx: 1.1.0 @vue/babel-sugar-functional-vue: 1.0.0 @vue/babel-sugar-inject-h: 1.0.0 @vue/babel-sugar-v-model: 1.0.0 @vue/babel-sugar-v-on: 1.1.0 @vue/cli-overlay: 3.10.0 @vue/cli-plugin-babel: ^3.10.0 => 3.10.0 @vue/cli-plugin-eslint: ^3.10.0 => 3.10.0 @vue/cli-plugin-unit-jest: ^3.10.0 => 3.10.0 @vue/cli-service: ^3.10.0 => 3.10.0 @vue/cli-shared-utils: 3.10.0 @vue/component-compiler-utils: 2.6.0 (3.0.0) @vue/preload-webpack-plugin: 1.1.1 @vue/test-utils: 1.0.0-beta.29 => 1.0.0-beta.29 @vue/web-component-wrapper: 1.2.0 eslint-plugin-vue: ^5.0.0 => 5.2.3 (4.7.1) jest-serializer-vue: 2.0.2 vue: ^2.6.10 => 2.6.10 vue-eslint-parser: 5.0.0 (2.0.3) vue-hot-reload-api: 2.3.3 vue-jest: 3.0.4 vue-loader: 15.7.1 vue-style-loader: 4.1.2 vue-template-compiler: ^2.6.10 => 2.6.10 vue-template-es2015-compiler: 1.9.1 npmGlobalPackages: @vue/cli: Not Found
vue create
src/**/__test__/*.js
yarn lint
yarn lint passes
yarn run v1.17.3 $ vue-cli-service lint error: 'describe' is not defined (no-undef) at src/components/__tests__/HelloWorld.spec.js:4:1: 2 | import HelloWorld from '@/components/HelloWorld.vue' 3 | > 4 | describe('HelloWorld.vue', () => { | ^ 5 | it('renders props.msg when passed', () => { 6 | const msg = 'new message' 7 | const wrapper = shallowMount(HelloWorld, { error: 'it' is not defined (no-undef) at src/components/__tests__/HelloWorld.spec.js:5:3: 3 | 4 | describe('HelloWorld.vue', () => { > 5 | it('renders props.msg when passed', () => { | ^ 6 | const msg = 'new message' 7 | const wrapper = shallowMount(HelloWorld, { 8 | propsData: { msg } error: 'expect' is not defined (no-undef) at src/components/__tests__/HelloWorld.spec.js:10:5: 8 | propsData: { msg } 9 | }) > 10 | expect(wrapper.text()).toMatch(msg) | ^ 11 | }) 12 | }) 13 |
The /tests/unit/.eslintrc configures eslint for jest tests, but it only applies to tests in that subdirectory. It ignores tests in /src/**/__tests__/.
/tests/unit/.eslintrc
/src/**/__tests__/
I chose to report this in vue-cli instead of vue-test-utils because I guess this needs to be fixed in the vue-cli-plugin-unit-jest generator.
vue-cli-plugin-unit-jest
The text was updated successfully, but these errors were encountered:
we could probably extend the base eslint config with something like:
{ overrides: [ { files: "**/__tests__/*.(js|jsx|ts|tsx)", env: { jest: true } } ] }
...and do the same for the mocha plugin.
Sorry, something went wrong.
fix(eslint): eslint should override env
61a0b08
for **/tests/** subfolders close #4397
58177d2
fix: eslint should override env for **/tests/** subfolders (#4447)
6f44f2a
close #4397 (cherry picked from commit 58177d2)
LinusBorg
No branches or pull requests
Version
3.10.0
Reproduction link
https://github.com/reproducing/reproduce-eslint-tests
Environment info
Steps to reproduce
vue create
with jest unit testssrc/**/__test__/*.js
as in the docs: https://vue-test-utils.vuejs.org/guides/#testing-single-file-components-with-jest ; https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-unit-jest ;yarn lint
What is expected?
yarn lint passes
What is actually happening?
The
/tests/unit/.eslintrc
configures eslint for jest tests, but it only applies to tests in that subdirectory. It ignores tests in/src/**/__tests__/
.I chose to report this in vue-cli instead of vue-test-utils because I guess this needs to be fixed in the
vue-cli-plugin-unit-jest
generator.The text was updated successfully, but these errors were encountered: