Skip to content

Commit 5570b2c

Browse files
authored
Merge pull request #2 from CemWebDev/feat/tests
test: add Vitest smoke test, setupTests, CI update, ESLint plugin
2 parents 1851d8d + ad72dc1 commit 5570b2c

7 files changed

Lines changed: 1651 additions & 68 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ jobs:
1313
cache: 'npm'
1414

1515
- run: npm ci
16+
- run: npm test -- --run
1617
- run: npm run build

eslint.config.js

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
import js from '@eslint/js'
2-
import globals from 'globals'
3-
import react from 'eslint-plugin-react'
4-
import reactHooks from 'eslint-plugin-react-hooks'
5-
import reactRefresh from 'eslint-plugin-react-refresh'
1+
import js from '@eslint/js';
2+
import globals from 'globals';
3+
import react from 'eslint-plugin-react';
4+
import reactHooks from 'eslint-plugin-react-hooks';
5+
import reactRefresh from 'eslint-plugin-react-refresh';
6+
import vitest from 'eslint-plugin-vitest';
67

8+
/** @type {import('eslint').Linter.FlatConfig[]} */
79
export default [
810
{ ignores: ['dist'] },
11+
912
{
1013
files: ['**/*.{js,jsx}'],
1114
languageOptions: {
@@ -35,4 +38,17 @@ export default [
3538
],
3639
},
3740
},
38-
]
41+
42+
{
43+
files: ['**/*.test.{js,jsx,ts,tsx}', '**/__tests__/**/*.{js,jsx,ts,tsx}'],
44+
plugins: { vitest },
45+
languageOptions: {
46+
globals: {
47+
...vitest.environments.vitest.globals,
48+
},
49+
},
50+
rules: {
51+
...vitest.configs.recommended.rules,
52+
},
53+
},
54+
];

0 commit comments

Comments
 (0)