Skip to content

Commit f480fc6

Browse files
committed
tests: update tests configuration
1 parent 73a78d0 commit f480fc6

File tree

3 files changed

+37
-3
lines changed

3 files changed

+37
-3
lines changed

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
# Folders to ignore
12
.DS_Store
2-
node_modules
3-
dist
3+
coverage/
4+
dist/
5+
node_modules/
46
yarn.lock
57

68
# local env files

jest.config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* Copyright (c) 2013-present, creativeLabs Lukasz Holeczek.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
'use strict'
9+
10+
module.exports = {
11+
moduleFileExtensions: ['tsx', 'js', 'ts', 'json', 'vue'],
12+
preset: 'ts-jest',
13+
setupFiles: ['jest-canvas-mock'],
14+
testEnvironment: 'jsdom',
15+
testEnvironmentOptions: {
16+
customExportConditions: ['node', 'node-addons'],
17+
},
18+
testPathIgnorePatterns: ['dist/'],
19+
transform: {
20+
'.*\\.(ts)$': 'ts-jest',
21+
'.*\\.(vue)$': '@vue/vue3-jest',
22+
},
23+
}

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,29 @@
3232
"src/"
3333
],
3434
"scripts": {
35-
"build": "rollup -c --bundleConfigAsCjs"
35+
"build": "rollup -c --bundleConfigAsCjs",
36+
"test": "jest --coverage",
37+
"test:clear": "jest --clearCache",
38+
"test:update": "jest --coverage --updateSnapshot"
3639
},
3740
"devDependencies": {
3841
"@coreui/chartjs": "^3.1.1",
3942
"@rollup/plugin-commonjs": "^24.0.1",
4043
"@rollup/plugin-node-resolve": "^15.0.1",
4144
"@rollup/plugin-typescript": "^11.0.0",
4245
"@types/lodash": "^4.14.192",
46+
"@types/jest": "^29.5.0",
4347
"@vue/test-utils": "^2.3.2",
48+
"@vue/vue3-jest": "29.2.3",
4449
"chart.js": "^3.9.1",
50+
"jest": "^29.5.0",
51+
"jest-canvas-mock": "^2.4.0",
52+
"jest-environment-jsdom": "^29.5.0",
4553
"lodash": "^4.17.21",
4654
"rollup": "^3.20.2",
4755
"rollup-plugin-peer-deps-external": "^2.2.4",
4856
"rollup-plugin-vue": "^6.0.0",
57+
"ts-jest": "^29.0.5",
4958
"tslib": "^2.5.0",
5059
"typescript": "^4.9.5",
5160
"vue": "^3.2.47",

0 commit comments

Comments
 (0)