Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit c792d08

Browse files
Merge pull request #248 from chakra-ui/chore/merge-tests
Chore/merge tests
2 parents 4f3356c + 18e7863 commit c792d08

File tree

58 files changed

+905
-779
lines changed

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

+905
-779
lines changed

.eslintrc.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,21 @@ module.exports = {
33
env: {
44
node: true
55
},
6-
'extends': [
6+
plugins: ['testing-library'],
7+
extends: [
78
'plugin:vue/essential',
89
'@vue/standard',
9-
'@nuxtjs'
10+
'@nuxtjs',
11+
'plugin:testing-library/recommended',
12+
'plugin:testing-library/vue'
1013
],
1114
rules: {
1215
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
1316
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
14-
'curly': 'off'
17+
curly: 'off',
18+
'testing-library/no-debug': 'error',
19+
'testing-library/prefer-screen-queries': 'error',
20+
'testing-library/await-fire-event': 'error'
1521
},
1622
parserOptions: {
1723
parser: 'babel-eslint'
@@ -23,10 +29,7 @@ module.exports = {
2329
},
2430
overrides: [
2531
{
26-
files: [
27-
'**/__tests__/*.{j,t}s?(x)',
28-
'**/tests/*.{j,t}s?(x)'
29-
],
32+
files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/*.{j,t}s?(x)'],
3033
env: {
3134
jest: true
3235
}
File renamed without changes.

.github/workflows/test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Build & Test Components
5+
6+
on:
7+
# Trigger the workflow on push or pull request,
8+
# but only for the master branch
9+
push:
10+
branches:
11+
- develop
12+
pull_request:
13+
branches:
14+
- develop
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
node-version: [12.x]
22+
steps:
23+
- uses: actions/checkout@v2
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v1
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
- run: yarn
29+
- run: yarn bootstrap
30+
- run: yarn lint
31+
- run: yarn build --if-present
32+
- run: yarn test
33+
env:
34+
CI: true

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
],
77
env: {
88
test: {
9-
plugins: ['transform-es2015-modules-commonjs']
9+
// plugins: ['transform-es2015-modules-commonjs']
1010
}
1111
}
1212
}

jest.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ module.exports = {
2929
watchPlugins: [
3030
'jest-watch-typeahead/filename',
3131
'jest-watch-typeahead/testname'
32-
]
32+
],
33+
testEnvironmentOptions: { resources: 'usable' }
3334
}

jsconfig.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"compilerOptions": {
3+
"baseUrl": ".",
4+
"paths": {
5+
"~/*": ["./*"],
6+
"@/*": ["./*"],
7+
"~~/*": ["./*"],
8+
"@@/*": ["./*"]
9+
}
10+
},
11+
"exclude": ["node_modules", ".nuxt", "dist"]
12+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
"eslint-loader": "^3.0.3",
149149
"eslint-plugin-nuxt": ">=0.4.2",
150150
"eslint-plugin-prettier": "^3.1.2",
151+
"eslint-plugin-testing-library": "^3.3.1",
151152
"jest": "^25.1.0",
152153
"prettier": "^1.19.1",
153154
"rimraf": "^3.0.2",

0 commit comments

Comments
 (0)