Skip to content

Commit d3584b2

Browse files
authored
migrate @graphiql/react to vitest (#3829)
* aa * aa * aa * aa * rm * fix lint
1 parent 3633d61 commit d3584b2

19 files changed

+332
-51
lines changed

.eslintrc.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,14 @@ module.exports = {
333333
'unicorn/prefer-node-protocol': 'error',
334334
'import-x/no-unresolved': [
335335
'error',
336-
{ ignore: ['^node:', '\\.svg\\?react$', 'vitest/config'] },
336+
{
337+
ignore: [
338+
'^node:',
339+
'\\.svg\\?react$',
340+
'vitest/config',
341+
'./vite.config.mjs',
342+
],
343+
},
337344
],
338345
'no-extra-boolean-cast': [
339346
'error',
@@ -430,6 +437,7 @@ module.exports = {
430437
'**/tests/**',
431438
'test.config.js',
432439
'vitest.config.mts',
440+
'setup-files.ts',
433441
],
434442
rules: {
435443
'import-x/no-extraneous-dependencies': 'off',

packages/graphiql-react/__mocks__/svg.jsx

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/graphiql-react/jest.config.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/graphiql-react/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"scripts": {
4141
"prebuild": "rimraf dist types",
4242
"dev": "concurrently 'tsc --emitDeclarationOnly --watch' 'vite build --watch'",
43-
"build": "tsc --emitDeclarationOnly && vite build"
43+
"build": "tsc --emitDeclarationOnly && vite build",
44+
"test": "vitest"
4445
},
4546
"peerDependencies": {
4647
"graphql": "^15.5.0 || ^16.0.0 || ^17.0.0",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use no memo';
2+
3+
import '@testing-library/jest-dom';

packages/graphiql-react/src/editor/__tests__/common.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use no memo';
2+
13
import { importCodeMirror } from '../common';
24

35
describe('importCodeMirror', () => {

packages/graphiql-react/src/editor/__tests__/tabs.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use no memo';
2+
13
import { StorageAPI } from '@graphiql/toolkit';
24
import {
35
createTab,

packages/graphiql-react/src/editor/__tests__/whitespace.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use no memo';
2+
13
import { invalidCharacters, normalizeWhitespace } from '../whitespace';
24

35
describe('normalizeWhitespace', () => {

packages/graphiql-react/src/explorer/components/__tests__/doc-explorer.spec.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use no memo';
2+
13
import { render } from '@testing-library/react';
24
import { GraphQLInt, GraphQLObjectType, GraphQLSchema } from 'graphql';
35
import { useContext, useEffect } from 'react';

packages/graphiql-react/src/explorer/components/__tests__/field-documentation.spec.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use no memo';
2+
13
import { fireEvent, render } from '@testing-library/react';
24
import { GraphQLString, GraphQLObjectType, Kind } from 'graphql';
35

0 commit comments

Comments
 (0)