diff --git a/packages/@vue/cli-plugin-e2e-cypress/README.md b/packages/@vue/cli-plugin-e2e-cypress/README.md index 70ca72a2ec..a1494eb74d 100644 --- a/packages/@vue/cli-plugin-e2e-cypress/README.md +++ b/packages/@vue/cli-plugin-e2e-cypress/README.md @@ -37,7 +37,7 @@ Cypress offers a rich interactive interface for running E2E tests, but currently ## Configuration -We've pre-configured Cypress to place most of the e2e testing related files under `/test/e2e`. You can also check out [how to configure Cypress via `cypress.json`](https://docs.cypress.io/guides/references/configuration.html#Options). +We've pre-configured Cypress to place most of the e2e testing related files under `/tests/e2e`. You can also check out [how to configure Cypress via `cypress.json`](https://docs.cypress.io/guides/references/configuration.html#Options). ## Installing in an Already Created Project diff --git a/packages/@vue/cli-plugin-e2e-cypress/generator/template/cypress.json b/packages/@vue/cli-plugin-e2e-cypress/generator/template/cypress.json index a2a911629a..470c720199 100644 --- a/packages/@vue/cli-plugin-e2e-cypress/generator/template/cypress.json +++ b/packages/@vue/cli-plugin-e2e-cypress/generator/template/cypress.json @@ -1,3 +1,3 @@ { - "pluginsFile": "test/e2e/plugins/index.js" + "pluginsFile": "tests/e2e/plugins/index.js" } diff --git a/packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/plugins/index.js b/packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/plugins/index.js deleted file mode 100644 index 49398583d3..0000000000 --- a/packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/plugins/index.js +++ /dev/null @@ -1,11 +0,0 @@ -// https://docs.cypress.io/guides/guides/plugins-guide.html - -module.exports = (on, config) => { - return Object.assign({}, config, { - fixturesFolder: 'test/e2e/fixtures', - integrationFolder: 'test/e2e/specs', - screenshotsFolder: 'test/e2e/screenshots', - videosFolder: 'test/e2e/videos', - supportFile: 'test/e2e/support/index.js' - }) -} diff --git a/packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/_eslintrc b/packages/@vue/cli-plugin-e2e-cypress/generator/template/tests/e2e/_eslintrc similarity index 100% rename from packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/_eslintrc rename to packages/@vue/cli-plugin-e2e-cypress/generator/template/tests/e2e/_eslintrc diff --git a/packages/@vue/cli-plugin-e2e-cypress/generator/template/tests/e2e/plugins/index.js b/packages/@vue/cli-plugin-e2e-cypress/generator/template/tests/e2e/plugins/index.js new file mode 100644 index 0000000000..71f26cdef8 --- /dev/null +++ b/packages/@vue/cli-plugin-e2e-cypress/generator/template/tests/e2e/plugins/index.js @@ -0,0 +1,11 @@ +// https://docs.cypress.io/guides/guides/plugins-guide.html + +module.exports = (on, config) => { + return Object.assign({}, config, { + fixturesFolder: 'tests/e2e/fixtures', + integrationFolder: 'tests/e2e/specs', + screenshotsFolder: 'tests/e2e/screenshots', + videosFolder: 'tests/e2e/videos', + supportFile: 'tests/e2e/support/index.js' + }) +} diff --git a/packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/specs/test.js b/packages/@vue/cli-plugin-e2e-cypress/generator/template/tests/e2e/specs/test.js similarity index 100% rename from packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/specs/test.js rename to packages/@vue/cli-plugin-e2e-cypress/generator/template/tests/e2e/specs/test.js diff --git a/packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/support/commands.js b/packages/@vue/cli-plugin-e2e-cypress/generator/template/tests/e2e/support/commands.js similarity index 100% rename from packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/support/commands.js rename to packages/@vue/cli-plugin-e2e-cypress/generator/template/tests/e2e/support/commands.js diff --git a/packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/support/index.js b/packages/@vue/cli-plugin-e2e-cypress/generator/template/tests/e2e/support/index.js similarity index 100% rename from packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/support/index.js rename to packages/@vue/cli-plugin-e2e-cypress/generator/template/tests/e2e/support/index.js diff --git a/packages/@vue/cli-plugin-e2e-nightwatch/generator/template/test/e2e/custom-assertions/elementCount.js b/packages/@vue/cli-plugin-e2e-nightwatch/generator/template/tests/e2e/custom-assertions/elementCount.js similarity index 100% rename from packages/@vue/cli-plugin-e2e-nightwatch/generator/template/test/e2e/custom-assertions/elementCount.js rename to packages/@vue/cli-plugin-e2e-nightwatch/generator/template/tests/e2e/custom-assertions/elementCount.js diff --git a/packages/@vue/cli-plugin-e2e-nightwatch/generator/template/test/e2e/specs/test.js b/packages/@vue/cli-plugin-e2e-nightwatch/generator/template/tests/e2e/specs/test.js similarity index 100% rename from packages/@vue/cli-plugin-e2e-nightwatch/generator/template/test/e2e/specs/test.js rename to packages/@vue/cli-plugin-e2e-nightwatch/generator/template/tests/e2e/specs/test.js diff --git a/packages/@vue/cli-plugin-e2e-nightwatch/nightwatch.config.js b/packages/@vue/cli-plugin-e2e-nightwatch/nightwatch.config.js index ca88cb6e0e..f7a74aa07a 100644 --- a/packages/@vue/cli-plugin-e2e-nightwatch/nightwatch.config.js +++ b/packages/@vue/cli-plugin-e2e-nightwatch/nightwatch.config.js @@ -4,9 +4,9 @@ const deepmerge = require('deepmerge') const userOptions = JSON.parse(process.env.VUE_NIGHTWATCH_USER_OPTIONS || '{}') module.exports = deepmerge({ - src_folders: ['test/e2e/specs'], - output_folder: 'test/e2e/reports', - custom_assertions_path: ['test/e2e/custom-assertions'], + src_folders: ['tests/e2e/specs'], + output_folder: 'tests/e2e/reports', + custom_assertions_path: ['tests/e2e/custom-assertions'], selenium: { start_process: true, diff --git a/packages/@vue/cli-plugin-eslint/generator.js b/packages/@vue/cli-plugin-eslint/generator.js index daa1931a6d..6a138abb53 100644 --- a/packages/@vue/cli-plugin-eslint/generator.js +++ b/packages/@vue/cli-plugin-eslint/generator.js @@ -73,7 +73,7 @@ module.exports = (api, { config, lintOn = [] }) => { } } api.render(files => { - files['test/unit/.eslintrc'] = JSON.stringify(config, null, 2) + files['tests/unit/.eslintrc'] = JSON.stringify(config, null, 2) }) } else if (api.hasPlugin('unit-jest')) { const config = { @@ -85,7 +85,7 @@ module.exports = (api, { config, lintOn = [] }) => { } } api.render(files => { - files['test/unit/.eslintrc'] = JSON.stringify(config, null, 2) + files['tests/unit/.eslintrc'] = JSON.stringify(config, null, 2) }) } diff --git a/packages/@vue/cli-plugin-unit-jest/README.md b/packages/@vue/cli-plugin-unit-jest/README.md index 7ec999da5a..8b793209b3 100644 --- a/packages/@vue/cli-plugin-unit-jest/README.md +++ b/packages/@vue/cli-plugin-unit-jest/README.md @@ -8,7 +8,7 @@ Run unit tests with Jest. Default files matches are: - - Any files in `test/unit` that end in `.spec.(js|ts)`; + - Any files in `tests/unit` that end in `.spec.(js|ts)`; - Any js/ts files inside `__tests__` directories. Usage: `vue-cli-service test [options] ` diff --git a/packages/@vue/cli-plugin-unit-jest/__tests__/jestGenerator.spec.js b/packages/@vue/cli-plugin-unit-jest/__tests__/jestGenerator.spec.js index 4e39f9f279..61b79330fc 100644 --- a/packages/@vue/cli-plugin-unit-jest/__tests__/jestGenerator.spec.js +++ b/packages/@vue/cli-plugin-unit-jest/__tests__/jestGenerator.spec.js @@ -18,8 +18,8 @@ test('base', async () => { expect(pkg.scripts.test).toBeTruthy() expect(pkg.devDependencies).toHaveProperty('@vue/test-utils') expect(pkg.devDependencies).toHaveProperty('babel-jest') - expect(files['test/unit/.eslintrc']).toMatch('"jest": true') + expect(files['tests/unit/.eslintrc']).toMatch('"jest": true') - const spec = files['test/unit/HelloWorld.spec.js'] + const spec = files['tests/unit/HelloWorld.spec.js'] expect(spec).toMatch(`expect(wrapper.text()).toMatch(msg)`) }) diff --git a/packages/@vue/cli-plugin-unit-jest/generator/index.js b/packages/@vue/cli-plugin-unit-jest/generator/index.js index 0d913e0519..82d28f3500 100644 --- a/packages/@vue/cli-plugin-unit-jest/generator/index.js +++ b/packages/@vue/cli-plugin-unit-jest/generator/index.js @@ -62,7 +62,7 @@ module.exports = api => { if (api.hasPlugin('eslint')) { api.render(files => { - files['test/unit/.eslintrc'] = JSON.stringify({ + files['tests/unit/.eslintrc'] = JSON.stringify({ env: { jest: true }, rules: { 'import/no-extraneous-dependencies': 'off' diff --git a/packages/@vue/cli-plugin-unit-jest/generator/template/test/unit/HelloWorld.spec.js b/packages/@vue/cli-plugin-unit-jest/generator/template/tests/unit/HelloWorld.spec.js similarity index 100% rename from packages/@vue/cli-plugin-unit-jest/generator/template/test/unit/HelloWorld.spec.js rename to packages/@vue/cli-plugin-unit-jest/generator/template/tests/unit/HelloWorld.spec.js diff --git a/packages/@vue/cli-plugin-unit-jest/index.js b/packages/@vue/cli-plugin-unit-jest/index.js index a413d7f89c..d468e71729 100644 --- a/packages/@vue/cli-plugin-unit-jest/index.js +++ b/packages/@vue/cli-plugin-unit-jest/index.js @@ -19,7 +19,7 @@ module.exports = api => { let testMatch = [] if (!args._.length) { - testMatch = [`--testMatch`, `/(test/unit/**/*.spec.(ts|tsx|js)|**/__tests__/*.(ts|tsx|js))`] + testMatch = [`--testMatch`, `/(tests/unit/**/*.spec.(ts|tsx|js)|**/__tests__/*.(ts|tsx|js))`] } const argv = [ diff --git a/packages/@vue/cli-plugin-unit-mocha/README.md b/packages/@vue/cli-plugin-unit-mocha/README.md index 3462a365d7..0dee365b53 100644 --- a/packages/@vue/cli-plugin-unit-mocha/README.md +++ b/packages/@vue/cli-plugin-unit-mocha/README.md @@ -24,7 +24,7 @@ --include include the given module into test bundle ``` - Default files matches are: any files in `test/unit` that end in `.spec.(ts|js)`. + Default files matches are: any files in `tests/unit` that end in `.spec.(ts|js)`. All [mocha-webpack command line options](http://zinserjan.github.io/mocha-webpack/docs/installation/cli-usage.html) are also supported. diff --git a/packages/@vue/cli-plugin-unit-mocha/__tests__/mochaGenerator.spec.js b/packages/@vue/cli-plugin-unit-mocha/__tests__/mochaGenerator.spec.js index ffb8c157b1..316229e036 100644 --- a/packages/@vue/cli-plugin-unit-mocha/__tests__/mochaGenerator.spec.js +++ b/packages/@vue/cli-plugin-unit-mocha/__tests__/mochaGenerator.spec.js @@ -17,9 +17,9 @@ test('base', async () => { expect(pkg.scripts.test).toBeTruthy() expect(pkg.devDependencies).toHaveProperty('@vue/test-utils') - expect(files['test/unit/.eslintrc']).toMatch('"mocha": true') + expect(files['tests/unit/.eslintrc']).toMatch('"mocha": true') - const spec = files['test/unit/HelloWorld.spec.js'] + const spec = files['tests/unit/HelloWorld.spec.js'] expect(spec).toMatch(`import { expect } from 'chai'`) expect(spec).toMatch(`expect(wrapper.text()).to.include(msg)`) }) diff --git a/packages/@vue/cli-plugin-unit-mocha/generator/index.js b/packages/@vue/cli-plugin-unit-mocha/generator/index.js index e98125a497..db1632b4e0 100644 --- a/packages/@vue/cli-plugin-unit-mocha/generator/index.js +++ b/packages/@vue/cli-plugin-unit-mocha/generator/index.js @@ -15,7 +15,7 @@ module.exports = api => { if (api.hasPlugin('eslint')) { api.render(files => { - files['test/unit/.eslintrc'] = JSON.stringify({ + files['tests/unit/.eslintrc'] = JSON.stringify({ env: { mocha: true }, rules: { 'import/no-extraneous-dependencies': 'off' diff --git a/packages/@vue/cli-plugin-unit-mocha/generator/template/test/unit/HelloWorld.spec.js b/packages/@vue/cli-plugin-unit-mocha/generator/template/tests/unit/HelloWorld.spec.js similarity index 100% rename from packages/@vue/cli-plugin-unit-mocha/generator/template/test/unit/HelloWorld.spec.js rename to packages/@vue/cli-plugin-unit-mocha/generator/template/tests/unit/HelloWorld.spec.js diff --git a/packages/@vue/cli-plugin-unit-mocha/index.js b/packages/@vue/cli-plugin-unit-mocha/index.js index ec75c6a705..883e01782b 100644 --- a/packages/@vue/cli-plugin-unit-mocha/index.js +++ b/packages/@vue/cli-plugin-unit-mocha/index.js @@ -42,8 +42,8 @@ module.exports = api => { ...rawArgv, ...(hasInlineFilesGlob ? [] : [ api.hasPlugin('typescript') - ? `test/unit/**/*.spec.ts` - : `test/unit/**/*.spec.js` + ? `tests/unit/**/*.spec.ts` + : `tests/unit/**/*.spec.js` ]) ] diff --git a/packages/@vue/cli-service/generator/template/_gitignore b/packages/@vue/cli-service/generator/template/_gitignore index 1daa675611..fbccff2ab2 100644 --- a/packages/@vue/cli-service/generator/template/_gitignore +++ b/packages/@vue/cli-service/generator/template/_gitignore @@ -3,13 +3,13 @@ node_modules /dist <%_ if (rootOptions.plugins && rootOptions.plugins['@vue/cli-plugin-e2e-nightwatch']) { _%> -/test/e2e/reports/ +/tests/e2e/reports/ selenium-debug.log <%_ } _%> <%_ if (rootOptions.plugins && rootOptions.plugins['@vue/cli-plugin-e2e-cypress']) { _%> -/test/e2e/videos/ -/test/e2e/screenshots/ +/tests/e2e/videos/ +/tests/e2e/screenshots/ <%_ } _%> # local env files