Skip to content

Commit 64b4515

Browse files
committed
refactor: change default test directory name to "tests"
BREAKING CHANGE: all tests are now located in "tests" instead of "test" close #877
1 parent 88726a3 commit 64b4515

File tree

23 files changed

+32
-32
lines changed

23 files changed

+32
-32
lines changed

packages/@vue/cli-plugin-e2e-cypress/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Cypress offers a rich interactive interface for running E2E tests, but currently
3737

3838
## Configuration
3939

40-
We've pre-configured Cypress to place most of the e2e testing related files under `<projectRoot>/test/e2e`. You can also check out [how to configure Cypress via `cypress.json`](https://docs.cypress.io/guides/references/configuration.html#Options).
40+
We've pre-configured Cypress to place most of the e2e testing related files under `<projectRoot>/tests/e2e`. You can also check out [how to configure Cypress via `cypress.json`](https://docs.cypress.io/guides/references/configuration.html#Options).
4141

4242
## Installing in an Already Created Project
4343

Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"pluginsFile": "test/e2e/plugins/index.js"
2+
"pluginsFile": "tests/e2e/plugins/index.js"
33
}

packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/plugins/index.js

-11
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// https://docs.cypress.io/guides/guides/plugins-guide.html
2+
3+
module.exports = (on, config) => {
4+
return Object.assign({}, config, {
5+
fixturesFolder: 'tests/e2e/fixtures',
6+
integrationFolder: 'tests/e2e/specs',
7+
screenshotsFolder: 'tests/e2e/screenshots',
8+
videosFolder: 'tests/e2e/videos',
9+
supportFile: 'tests/e2e/support/index.js'
10+
})
11+
}

packages/@vue/cli-plugin-e2e-nightwatch/nightwatch.config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ const deepmerge = require('deepmerge')
44
const userOptions = JSON.parse(process.env.VUE_NIGHTWATCH_USER_OPTIONS || '{}')
55

66
module.exports = deepmerge({
7-
src_folders: ['test/e2e/specs'],
8-
output_folder: 'test/e2e/reports',
9-
custom_assertions_path: ['test/e2e/custom-assertions'],
7+
src_folders: ['tests/e2e/specs'],
8+
output_folder: 'tests/e2e/reports',
9+
custom_assertions_path: ['tests/e2e/custom-assertions'],
1010

1111
selenium: {
1212
start_process: true,

packages/@vue/cli-plugin-eslint/generator.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ module.exports = (api, { config, lintOn = [] }) => {
7373
}
7474
}
7575
api.render(files => {
76-
files['test/unit/.eslintrc'] = JSON.stringify(config, null, 2)
76+
files['tests/unit/.eslintrc'] = JSON.stringify(config, null, 2)
7777
})
7878
} else if (api.hasPlugin('unit-jest')) {
7979
const config = {
@@ -85,7 +85,7 @@ module.exports = (api, { config, lintOn = [] }) => {
8585
}
8686
}
8787
api.render(files => {
88-
files['test/unit/.eslintrc'] = JSON.stringify(config, null, 2)
88+
files['tests/unit/.eslintrc'] = JSON.stringify(config, null, 2)
8989
})
9090
}
9191

packages/@vue/cli-plugin-unit-jest/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Run unit tests with Jest. Default files matches are:
1010

11-
- Any files in `test/unit` that end in `.spec.(js|ts)`;
11+
- Any files in `tests/unit` that end in `.spec.(js|ts)`;
1212
- Any js/ts files inside `__tests__` directories.
1313

1414
Usage: `vue-cli-service test [options] <regexForTestFiles>`

packages/@vue/cli-plugin-unit-jest/__tests__/jestGenerator.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ test('base', async () => {
1818
expect(pkg.scripts.test).toBeTruthy()
1919
expect(pkg.devDependencies).toHaveProperty('@vue/test-utils')
2020
expect(pkg.devDependencies).toHaveProperty('babel-jest')
21-
expect(files['test/unit/.eslintrc']).toMatch('"jest": true')
21+
expect(files['tests/unit/.eslintrc']).toMatch('"jest": true')
2222

23-
const spec = files['test/unit/HelloWorld.spec.js']
23+
const spec = files['tests/unit/HelloWorld.spec.js']
2424
expect(spec).toMatch(`expect(wrapper.text()).toMatch(msg)`)
2525
})

packages/@vue/cli-plugin-unit-jest/generator/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module.exports = api => {
6262

6363
if (api.hasPlugin('eslint')) {
6464
api.render(files => {
65-
files['test/unit/.eslintrc'] = JSON.stringify({
65+
files['tests/unit/.eslintrc'] = JSON.stringify({
6666
env: { jest: true },
6767
rules: {
6868
'import/no-extraneous-dependencies': 'off'

packages/@vue/cli-plugin-unit-jest/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = api => {
1919

2020
let testMatch = []
2121
if (!args._.length) {
22-
testMatch = [`--testMatch`, `<rootDir>/(test/unit/**/*.spec.(ts|tsx|js)|**/__tests__/*.(ts|tsx|js))`]
22+
testMatch = [`--testMatch`, `<rootDir>/(tests/unit/**/*.spec.(ts|tsx|js)|**/__tests__/*.(ts|tsx|js))`]
2323
}
2424

2525
const argv = [

packages/@vue/cli-plugin-unit-mocha/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
--include include the given module into test bundle
2525
```
2626

27-
Default files matches are: any files in `test/unit` that end in `.spec.(ts|js)`.
27+
Default files matches are: any files in `tests/unit` that end in `.spec.(ts|js)`.
2828

2929
All [mocha-webpack command line options](http://zinserjan.github.io/mocha-webpack/docs/installation/cli-usage.html) are also supported.
3030

packages/@vue/cli-plugin-unit-mocha/__tests__/mochaGenerator.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ test('base', async () => {
1717

1818
expect(pkg.scripts.test).toBeTruthy()
1919
expect(pkg.devDependencies).toHaveProperty('@vue/test-utils')
20-
expect(files['test/unit/.eslintrc']).toMatch('"mocha": true')
20+
expect(files['tests/unit/.eslintrc']).toMatch('"mocha": true')
2121

22-
const spec = files['test/unit/HelloWorld.spec.js']
22+
const spec = files['tests/unit/HelloWorld.spec.js']
2323
expect(spec).toMatch(`import { expect } from 'chai'`)
2424
expect(spec).toMatch(`expect(wrapper.text()).to.include(msg)`)
2525
})

packages/@vue/cli-plugin-unit-mocha/generator/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = api => {
1515

1616
if (api.hasPlugin('eslint')) {
1717
api.render(files => {
18-
files['test/unit/.eslintrc'] = JSON.stringify({
18+
files['tests/unit/.eslintrc'] = JSON.stringify({
1919
env: { mocha: true },
2020
rules: {
2121
'import/no-extraneous-dependencies': 'off'

packages/@vue/cli-plugin-unit-mocha/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ module.exports = api => {
4242
...rawArgv,
4343
...(hasInlineFilesGlob ? [] : [
4444
api.hasPlugin('typescript')
45-
? `test/unit/**/*.spec.ts`
46-
: `test/unit/**/*.spec.js`
45+
? `tests/unit/**/*.spec.ts`
46+
: `tests/unit/**/*.spec.js`
4747
])
4848
]
4949

packages/@vue/cli-service/generator/template/_gitignore

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ node_modules
33
/dist
44
<%_ if (rootOptions.plugins && rootOptions.plugins['@vue/cli-plugin-e2e-nightwatch']) { _%>
55

6-
/test/e2e/reports/
6+
/tests/e2e/reports/
77
selenium-debug.log
88
<%_ } _%>
99
<%_ if (rootOptions.plugins && rootOptions.plugins['@vue/cli-plugin-e2e-cypress']) { _%>
1010

11-
/test/e2e/videos/
12-
/test/e2e/screenshots/
11+
/tests/e2e/videos/
12+
/tests/e2e/screenshots/
1313
<%_ } _%>
1414

1515
# local env files

0 commit comments

Comments
 (0)