Skip to content

Commit 52eac3a

Browse files
committed
Move component tests to tests/
1 parent 97f0b9d commit 52eac3a

17 files changed

+33
-14
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ npm-debug.log*
1818
yarn-debug.log*
1919
yarn-error.log*
2020
selenium-debug.log*
21+
vite.config.*.timestamp*
2122

2223
# Coverage
2324
.nyc_output/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ There are three groups of tests:
6969
* Unit tests
7070
* Simple unit tests for individual functions and classes.
7171
* **Framework:** [Vitest](https://vitest.dev/)
72-
* **Assertions:** [Chai](https://www.chaijs.com/)/[Jest](https://jestjs.io/docs/expect)
72+
* **Assertions:** [Chai](https://www.chaijs.com/)/[Vitest](https://vitest.dev/api/expect.html)
7373
* **Path:** `tests/unit`
7474
* **Command:** `yarn run test:unit` (watches by default, only re-runs changed file)
7575
* (To prevent watching, use `yarn vitest run`)
7676
* Component tests
7777
* In-browser tests which mount a single Vue component standalone.
7878
* **Framework:** [Cypress](https://docs.cypress.io/guides/overview/why-cypress)
7979
* **Assertions:** Chai
80-
* **Path:** `cypress/component`
80+
* **Path:** `tests/component`
8181
* **Command:** `yarn run test:component`
8282
* (For "headless" mode use `yarn cypress run --component --config video=false`)
8383
* End to end tests

cypress.config.cjs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,7 @@ module.exports = defineConfig({
3333
mode: 'development',
3434
})
3535
)
36-
37-
return Object.assign({}, config, {
38-
fixturesFolder: 'tests/e2e/fixtures',
39-
specPattern: 'tests/e2e/specs',
40-
screenshotsFolder: 'tests/e2e/screenshots',
41-
videosFolder: 'tests/e2e/videos',
42-
supportFile: 'tests/e2e/support/index.js'
43-
})
36+
return config
4437
},
4538
specPattern: 'tests/e2e/specs/**/*.cy.{js,jsx,ts,tsx}',
4639
supportFile: 'tests/e2e/support/index.js'
@@ -56,6 +49,9 @@ module.exports = defineConfig({
5649
require('@cypress/code-coverage/task')(on, config)
5750
return config
5851
},
52+
specPattern: 'tests/component/**/*.cy.{js,jsx,ts,tsx}',
53+
supportFile: 'tests/component/support/index.js',
54+
indexHtmlFile: 'tests/component/support/component-index.html'
5955
},
6056

6157
env: {

tests/component/.eslintrc.cjs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (C) NIWA & British Crown (Met Office) & Contributors.
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
module.exports = {
19+
plugins: [
20+
'cypress'
21+
],
22+
env: {
23+
'cypress/globals': true
24+
},
25+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)