Skip to content

Commit aaa0e2a

Browse files
authored
test: add smoke tests (#508)
1 parent b510bd4 commit aaa0e2a

File tree

3 files changed

+75
-0
lines changed

3 files changed

+75
-0
lines changed

.github/workflows/smoke-test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Smoke test
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * SUN'
6+
workflow_dispatch:
7+
release:
8+
types: [published]
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-node@v2
16+
with:
17+
node-version: 16
18+
- run: |
19+
npm install
20+
npm run build
21+
- run: npm link
22+
working-directory: ./dist
23+
- run: npm link eslint-plugin-testing-library
24+
- uses: AriPerkkio/eslint-remote-tester-run-action@v2
25+
with:
26+
issue-title: 'Results of weekly scheduled smoke test'
27+
eslint-remote-tester-config: tests/eslint-remote-tester.config.js

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
"eslint-plugin-node": "^11.1.0",
6363
"eslint-plugin-prettier": "^4.0.0",
6464
"eslint-plugin-promise": "^5.1.0",
65+
"eslint-remote-tester": "^2.0.1",
66+
"eslint-remote-tester-repositories": "^0.0.3",
6567
"husky": "^7.0.2",
6668
"is-ci": "^3.0.0",
6769
"jest": "^27.3.0",

tests/eslint-remote-tester.config.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires */
2+
/* eslint-disable import/no-extraneous-dependencies */
3+
const { rules } = require('eslint-plugin-testing-library');
4+
const {
5+
getRepositories,
6+
getPathIgnorePattern,
7+
} = require('eslint-remote-tester-repositories');
8+
9+
module.exports = {
10+
repositories: getRepositories({ randomize: true }),
11+
pathIgnorePattern: getPathIgnorePattern(),
12+
extensions: ['js', 'jsx', 'ts', 'tsx'],
13+
concurrentTasks: 3,
14+
cache: false,
15+
logLevel: 'info',
16+
eslintrc: {
17+
root: true,
18+
env: {
19+
es6: true,
20+
},
21+
parser: '@typescript-eslint/parser',
22+
parserOptions: {
23+
ecmaVersion: 2020,
24+
sourceType: 'module',
25+
ecmaFeatures: {
26+
jsx: true,
27+
},
28+
},
29+
plugins: ['testing-library'],
30+
rules: {
31+
...Object.keys(rules).reduce(
32+
(all, rule) => ({
33+
...all,
34+
[`testing-library/${rule}`]: 'error',
35+
}),
36+
{}
37+
),
38+
39+
// Rules with required options without default values
40+
'testing-library/consistent-data-testid': [
41+
'error',
42+
{ testIdPattern: '^{fileName}(__([A-Z]+[a-z]_?)+)_$' },
43+
],
44+
},
45+
},
46+
};

0 commit comments

Comments
 (0)