Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: init the test & add the tests of TutorialModal #61

Merged
merged 5 commits into from
Jan 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ babel.config.js
postcss.config.js
vue.config.js
.eslintrc.js
jest.config.js
11 changes: 7 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ module.exports = {
env: {
node: true
},
plugins: ['testing-library', 'jest-dom'],
'extends': [
'plugin:vue/essential',
'@vue/standard',
'@vue/typescript/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking'
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:testing-library/recommended',
'plugin:testing-library/vue',
'plugin:jest-dom/recommended'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
Expand All @@ -32,11 +36,10 @@ module.exports = {
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)'
'**/__tests__/*.{j,t}s?(x)'
],
env: {
mocha: true
jest: true
}
}
]
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,25 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Run test
- name: Run typecheck
run: |
npm ci
npm run typecheck
unit-test:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v1
- name: Use Node.js 10.x
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Run unit test
run: |
npm ci
npm run test
dev-deploy:
needs: [lint, typecheck]
needs: [lint, typecheck, unit-test]
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]') && github.event_name == 'push' && github.ref == 'refs/heads/master'"
steps:
Expand All @@ -61,7 +74,7 @@ jobs:
COMMIT_MESSAGE: Deploy [ci skip]
FOLDER: dist
production-deploy:
needs: [lint, typecheck]
needs: [lint, typecheck, unit-test]
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]') && github.event_name == 'push' && github.ref == 'refs/heads/production'"
steps:
Expand Down
5 changes: 5 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
preset: '@vue/cli-plugin-unit-jest/presets/typescript-and-babel',
setupFiles: ['<rootDir>/test/setup-files.ts'],
setupFilesAfterEnv: ['<rootDir>/test/setup-files-after-env.ts']
}
Loading