mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-12 19:23:51 +00:00
Fix unittesting after cypress addition
This commit is contained in:
parent
7c68d56df8
commit
4c666c1666
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
|
@ -31,8 +31,8 @@ jobs:
|
||||||
- name: Run type check
|
- name: Run type check
|
||||||
run: yarn check-types
|
run: yarn check-types
|
||||||
|
|
||||||
# - name: Run Tests
|
- name: Run Tests
|
||||||
# run: yarn test:unit
|
run: yarn test:unit
|
||||||
|
|
||||||
# - name: Cypress run
|
# - name: Cypress run
|
||||||
# uses: cypress-io/github-action@v2
|
# uses: cypress-io/github-action@v2
|
||||||
|
@ -40,7 +40,7 @@ jobs:
|
||||||
# build: yarn build
|
# build: yarn build
|
||||||
# start: yarn start
|
# start: yarn start
|
||||||
|
|
||||||
- name: Run Component tests 🧪
|
- name: Run Component tests
|
||||||
uses: cypress-io/github-action@v2
|
uses: cypress-io/github-action@v2
|
||||||
with:
|
with:
|
||||||
# we have already installed everything
|
# we have already installed everything
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
preset: '@vue/cli-plugin-unit-jest/presets/typescript-and-babel',
|
preset: '@vue/cli-plugin-unit-jest/presets/typescript-and-babel',
|
||||||
|
// testMatch: ['**/tests/unit/**/*.test.[jt]s?(x)'],
|
||||||
|
globals: {
|
||||||
|
'ts-jest': {
|
||||||
|
tsConfig: 'tests/tsconfig.json',
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,8 +9,9 @@
|
||||||
"lint": "vue-cli-service lint",
|
"lint": "vue-cli-service lint",
|
||||||
"check-types": "tsc --noemit",
|
"check-types": "tsc --noemit",
|
||||||
"lint-ci": "vue-cli-service lint --no-fix",
|
"lint-ci": "vue-cli-service lint --no-fix",
|
||||||
"cypress:open": "cypress open",
|
"cy:open": "cypress open",
|
||||||
"cypress:run-ct": "cypress run-ct"
|
"cy:open-ct": "cypress open-ct",
|
||||||
|
"cy:run-ct": "cypress run-ct"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cypress/vue": "^2.2.3",
|
"@cypress/vue": "^2.2.3",
|
||||||
|
|
12
tests/tsconfig.json
Normal file
12
tests/tsconfig.json
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"types": [
|
||||||
|
"jest",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"unit/*.ts",
|
||||||
|
"unit/*.tsx"
|
||||||
|
],
|
||||||
|
}
|
7
tests/unit/formatters.spec.ts
Normal file
7
tests/unit/formatters.spec.ts
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
import { formatPercent } from '@/shared/formatters';
|
||||||
|
|
||||||
|
describe('formatters.ts', () => {
|
||||||
|
it('Format percent correctly', () => {
|
||||||
|
expect(formatPercent(0.5)).toEqual('50.000%');
|
||||||
|
});
|
||||||
|
});
|
|
@ -15,7 +15,7 @@
|
||||||
"baseUrl": "src",
|
"baseUrl": "src",
|
||||||
"types": [
|
"types": [
|
||||||
"webpack-env",
|
"webpack-env",
|
||||||
"jest",
|
// "jest",
|
||||||
"cypress"
|
"cypress"
|
||||||
],
|
],
|
||||||
"paths": {
|
"paths": {
|
||||||
|
@ -28,10 +28,9 @@
|
||||||
"src/**/*.ts",
|
"src/**/*.ts",
|
||||||
"src/**/*.tsx",
|
"src/**/*.tsx",
|
||||||
"src/**/*.vue",
|
"src/**/*.vue",
|
||||||
"tests/**/*.ts",
|
|
||||||
"tests/**/*.tsx"
|
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules",
|
||||||
|
// "tests"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user