diff --git a/.eslintrc.js b/.eslintrc.js index 3bced62f5f..5e770d980e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -407,6 +407,13 @@ module.exports = { '**/*.spec.{ts,js.jsx.tsx}', ], extends: ['plugin:@vitest/legacy-recommended'], + rules: { + '@vitest/expect-expect': [ + 'error', + { assertFunctionNames: ['expect*'] }, + ], + '@vitest/no-disabled-tests': 'error', + }, }, { // Resources are typically our helper scripts; make life easier there diff --git a/packages/codemirror-graphql/src/utils/__tests__/jsonParse.test.ts b/packages/codemirror-graphql/src/utils/__tests__/jsonParse.test.ts index bf4e92cf41..6d2a8044e0 100644 --- a/packages/codemirror-graphql/src/utils/__tests__/jsonParse.test.ts +++ b/packages/codemirror-graphql/src/utils/__tests__/jsonParse.test.ts @@ -20,7 +20,6 @@ describe('jsonParse', () => { expect(ast.members[0].value).toStrictEqual(value); } - // eslint-disable-next-line @vitest/expect-expect it('correctly parses escaped strings', () => { expectEscapedString( '{ "test": "\\"" }', diff --git a/packages/codemirror-graphql/src/variables/__tests__/hint.test.ts b/packages/codemirror-graphql/src/variables/__tests__/hint.test.ts index 7875af9ac2..1ada1754e8 100644 --- a/packages/codemirror-graphql/src/variables/__tests__/hint.test.ts +++ b/packages/codemirror-graphql/src/variables/__tests__/hint.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable @vitest/expect-expect */ /** * Copyright (c) 2021 GraphQL Contributors * All rights reserved. diff --git a/packages/graphql-language-service-server/src/__tests__/MessageProcessor.spec.ts b/packages/graphql-language-service-server/src/__tests__/MessageProcessor.spec.ts index a164a7079c..519b5ab0cb 100644 --- a/packages/graphql-language-service-server/src/__tests__/MessageProcessor.spec.ts +++ b/packages/graphql-language-service-server/src/__tests__/MessageProcessor.spec.ts @@ -117,7 +117,7 @@ describe('MessageProcessor with no config', () => { project.lsp.handleShutdownRequest(); }); - // TODO: this test fails + // eslint-disable-next-line @vitest/no-disabled-tests -- TODO: this test fails it.skip('initializes when presented with a valid config later', async () => { const project = new MockProject({ files: [...defaultFiles], @@ -150,7 +150,7 @@ describe('MessageProcessor with config', () => { fetchMock.mockRestore(); }); - // TODO: this test fails + // eslint-disable-next-line @vitest/no-disabled-tests -- TODO: this test fails it.skip('caches files and schema with .graphql file config, and the schema updates with watched file changes', async () => { const project = new MockProject({ files: [ @@ -354,7 +354,7 @@ describe('MessageProcessor with config', () => { project.lsp.handleShutdownRequest(); }); - // TODO: this test fails + // eslint-disable-next-line @vitest/no-disabled-tests -- TODO: this test fails it.skip('caches files and schema with a URL config', async () => { const offset = parseInt(version, 10) > 16 ? 25 : 0; @@ -489,7 +489,7 @@ describe('MessageProcessor with config', () => { project.lsp.handleShutdownRequest(); }); - // TODO: this test fails + // eslint-disable-next-line @vitest/no-disabled-tests -- TODO: this test fails it.skip('caches multiple projects with files and schema with a URL config and a local schema', async () => { mockSchema(require('../../../graphiql/test/schema')); diff --git a/packages/graphql-language-service-server/src/__tests__/startServer.spec.ts b/packages/graphql-language-service-server/src/__tests__/startServer.spec.ts index 645a15d2b2..3c3f3b30b3 100644 --- a/packages/graphql-language-service-server/src/__tests__/startServer.spec.ts +++ b/packages/graphql-language-service-server/src/__tests__/startServer.spec.ts @@ -9,13 +9,13 @@ describe('startServer', () => { } catch {} } }); - // TODO: Blocked by https://github.com/vitest-dev/vitest/issues/7082 + // eslint-disable-next-line @vitest/no-disabled-tests -- TODO: Blocked by https://github.com/vitest-dev/vitest/issues/7082 it.skip('should start the server', async () => { c = await startServer(); // if the server starts, we're good expect(true).toBe(true); }); - // TODO: this one fails to exit properly in tests + // eslint-disable-next-line @vitest/no-disabled-tests -- TODO: this one fails to exit properly in tests it.skip('should start the server with stream', async () => { c = await startServer({ method: 'stream', @@ -23,7 +23,7 @@ describe('startServer', () => { // if the server starts, we're good expect(true).toBe(true); }); - // TODO: Blocked by https://github.com/vitest-dev/vitest/issues/7082 + // eslint-disable-next-line @vitest/no-disabled-tests -- TODO: Blocked by https://github.com/vitest-dev/vitest/issues/7082 it.skip('should start the server with ipc', async () => { c = await startServer({ method: 'node',