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: use @vitest/eslint-plugin #2845

Merged
merged 1 commit into from
Nov 10, 2024
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
16 changes: 10 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"prettier",
"react-hooks",
"import",
"vitest",
"@vitest",
"testing-library",
"eslint-plugin-react-compiler"
],
Expand Down Expand Up @@ -51,10 +51,6 @@
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"vitest/consistent-test-it": [
"error",
{ "fn": "it", "withinDescribe": "it" }
],
"import/namespace": "off",
"import/named": "off",
"import/order": [
Expand Down Expand Up @@ -110,11 +106,19 @@
},
"overrides": [
{
"extends": ["plugin:testing-library/react"],
"extends": [
"plugin:testing-library/react",
"plugin:@vitest/legacy-recommended"
],
"files": ["tests/**/*.ts", "tests/**/*.tsx"],
"rules": {
"testing-library/no-node-access": "off",
"import/extensions": ["error", "never"],
"@vitest/expect-expect": "off",
"@vitest/consistent-test-it": [
"error",
{ "fn": "it", "withinDescribe": "it" }
],
"@typescript-eslint/no-unused-vars": "off"
}
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
"@typescript-eslint/eslint-plugin": "^8.12.2",
"@typescript-eslint/parser": "^8.12.2",
"@vitest/coverage-v8": "^2.1.4",
"@vitest/eslint-plugin": "^1.1.7",
"@vitest/ui": "^2.1.4",
"esbuild": "^0.24.0",
"eslint": "8.57.0",
Expand All @@ -131,7 +132,6 @@
"eslint-plugin-react-compiler": "19.0.0-beta-6fc168f-20241025",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-testing-library": "^6.4.0",
"eslint-plugin-vitest": "^0.5.4",
"immer": "^10.1.1",
"jsdom": "^25.0.1",
"json": "^11.0.0",
Expand Down
106 changes: 22 additions & 84 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions tests/devtools.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ describe('when it receives a message of type...', () => {
})

describe('ROLLBACK...', () => {
it('it updates state without recording and inits with `message.state`', async () => {
it('updates state without recording and inits with `message.state`', async () => {
const initialState = { count: 0, increment: () => {} }
const api = createStore(devtools(() => initialState, { enabled: true }))
const newState = { foo: 'bar' }
Expand Down Expand Up @@ -400,7 +400,7 @@ describe('when it receives a message of type...', () => {

describe('JUMP_TO_STATE...', () => {
const increment = () => {}
it('it updates state without recording with `message.state`', async () => {
it('updates state without recording with `message.state`', async () => {
const initialState = { count: 0, increment }
const api = createStore(devtools(() => initialState, { enabled: true }))
const newState = { foo: 'bar' }
Expand Down Expand Up @@ -450,7 +450,7 @@ describe('when it receives a message of type...', () => {
})

describe('JUMP_TO_ACTION...', () => {
it('it updates state without recording with `message.state`', async () => {
it('updates state without recording with `message.state`', async () => {
const initialState = { count: 0, increment: () => {} }
const api = createStore(devtools(() => initialState, { enabled: true }))
const newState = { foo: 'bar' }
Expand Down Expand Up @@ -1496,7 +1496,7 @@ describe('when create devtools was called multiple times with `name` option unde
})

describe('ROLLBACK...', () => {
it('it updates state without recording and inits with `message.state, connections are isolated from each other`', async () => {
it('updates state without recording and inits with `message.state, connections are isolated from each other`', async () => {
const options1 = { testConnectionId: 'asdf' }
const options2 = { testConnectionId: '2f' }
const options3 = { testConnectionId: 'd2e' }
Expand Down Expand Up @@ -1676,7 +1676,7 @@ describe('when create devtools was called multiple times with `name` option unde
const increment2 = () => {}
const increment3 = () => {}

it('it updates state without recording with `message.state`, connections are isolated from each other', async () => {
it('updates state without recording with `message.state`, connections are isolated from each other', async () => {
const options1 = { testConnectionId: 'asdf' }
const options2 = { testConnectionId: '2f' }
const options3 = { testConnectionId: 'd2e' }
Expand Down Expand Up @@ -1837,7 +1837,7 @@ describe('when create devtools was called multiple times with `name` option unde
const increment2 = () => {}
const increment3 = () => {}

it('it updates state without recording with `message.state`, connections are isolated from each other', async () => {
it('updates state without recording with `message.state`, connections are isolated from each other', async () => {
const options1 = { testConnectionId: 'asdf' }
const options2 = { testConnectionId: '2f' }
const options3 = { testConnectionId: 'd2e' }
Expand Down