Skip to content

Commit 879cab5

Browse files
authored
Merge pull request #156 from dnum-mi/tests/add-e2e-with-cypress
Tests/add e2e with cypress
2 parents 4bfd6b3 + 97dc5c2 commit 879cab5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+14552
-9487
lines changed

.eslintrc.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,16 @@ module.exports = {
3131
jest: true,
3232
},
3333
},
34+
{
35+
files: [
36+
'**/src/**/*.e2e.{j,t}s?(x)',
37+
],
38+
env: {
39+
'cypress/globals': true,
40+
},
41+
extends: [
42+
'plugin:cypress/recommended',
43+
],
44+
},
3445
],
3546
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"postcss": "css"
1313
},
1414
"eslint.workingDirectories": [{ "mode": "auto"}],
15+
"editor.codeActionsOnSave": {
16+
"source.fixAll": true,
17+
},
1518
"files.associations": {
1619
"*.css": "postcss"
1720
},

babel.config.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
module.exports = {
2+
presets: [[
3+
'@babel/preset-env',
4+
{
5+
targets:
6+
{ node: 'current' },
7+
},
8+
],
9+
],
210
plugins: [
311
'@babel/plugin-syntax-jsx',
412
],
5-
presets: [
6-
'@babel/preset-env',
7-
],
13+
env: {
14+
test: {
15+
plugins: [
16+
'babel-plugin-transform-import-meta',
17+
],
18+
},
19+
},
820
}

cypress.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
2-
"testFiles": "cypress/specs/**.spec.js",
2+
"testFiles": "cypress/tests/**/*.e2e.js",
33
"pluginsFile": "cypress/plugins/index.js",
4+
"video": false,
45
"component": {
56
"componentFolder": "src",
6-
"testFiles": "**.e2e.js*",
7+
"testFiles": "**/*.e2e.js*",
78
"viewportHeight": 500,
89
"viewportWidth": 700
910
}

cypress/support/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
// ***********************************************************
1515

1616
// Import commands.js using ES2015 syntax:
17-
import './commands'
17+
import './commands.js'
1818

1919
// Alternatively you can use CommonJS syntax:
2020
// require('./commands')
21+
import 'cypress-plugin-tab'

jest.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ module.exports = {
1414
// cacheDirectory: "/tmp/jest_rs",
1515

1616
// Automatically clear mock calls and instances between every test
17-
// clearMocks: false,
17+
clearMocks: true,
1818

1919
// Indicates whether the coverage information should be collected while executing the test
20-
// collectCoverage: false,
20+
collectCoverage: true,
2121

2222
// An array of glob patterns indicating a set of files for which coverage information should be collected
2323
// collectCoverageFrom: undefined,
@@ -149,7 +149,7 @@ module.exports = {
149149
// snapshotSerializers: [],
150150

151151
// The test environment that will be used for testing
152-
// testEnvironment: "jest-environment-jsdom",
152+
testEnvironment: 'jest-environment-jsdom',
153153

154154
// Options that will be passed to the testEnvironment
155155
// testEnvironmentOptions: {},
@@ -192,7 +192,7 @@ module.exports = {
192192
// '^.+\\.svg$': 'jest-svg-transformer',
193193
// '.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
194194
'^.+\\.js$': 'babel-jest',
195-
'^.+\\.vue$': 'vue-jest',
195+
'^.+\\.vue$': '@vue/vue3-jest',
196196
},
197197

198198
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation

0 commit comments

Comments
 (0)