From 5abf408b6116ec64c625d5818046b272686494b3 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Sat, 2 Nov 2024 14:03:37 +0100 Subject: [PATCH] fix: try again --- .github/workflows/pr-graphql-compat-check.yml | 6 ++--- .../__tests__/GraphQLLanguageService.test.ts | 25 ++++++++----------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/.github/workflows/pr-graphql-compat-check.yml b/.github/workflows/pr-graphql-compat-check.yml index a5f84f6ed0..c663991d9c 100644 --- a/.github/workflows/pr-graphql-compat-check.yml +++ b/.github/workflows/pr-graphql-compat-check.yml @@ -1,4 +1,4 @@ -name: Build & Test PR w/ GraphQL Regressions +name: Build & Test PR w/ GraphQL Peer Compatibility on: push: # only on merge to main. @@ -45,13 +45,13 @@ jobs: path: node_modules key: node_modules-${{hashFiles('yarn.lock')}} restore-keys: node_modules- - - name: Force GraphQL ${{ matrix.release }} solution + - name: Resolve GraphQL ${{ matrix.release }} to test run: yarn repo:resolve graphql@${{ matrix.release }} - run: yarn install --frozen-lockfile --immutable - name: Unit Tests - run: yarn test:ci + run: yarn test - name: Cypress run: yarn e2e diff --git a/packages/graphql-language-service-server/src/__tests__/GraphQLLanguageService.test.ts b/packages/graphql-language-service-server/src/__tests__/GraphQLLanguageService.test.ts index cc0bea70ed..9a2267be43 100644 --- a/packages/graphql-language-service-server/src/__tests__/GraphQLLanguageService.test.ts +++ b/packages/graphql-language-service-server/src/__tests__/GraphQLLanguageService.test.ts @@ -14,7 +14,12 @@ import { GraphQLLanguageService } from '../GraphQLLanguageService'; import { SymbolKind } from 'vscode-languageserver-protocol'; import { Position } from 'graphql-language-service'; import { NoopLogger } from '../Logger'; -import { GraphQLEnumType, version } from 'graphql'; +import { + GraphQLEnumType, + version, + FragmentDefinitionNode, + parse, +} from 'graphql'; const MOCK_CONFIG = { filepath: join(__dirname, '.graphqlrc.yml'), @@ -24,7 +29,7 @@ const MOCK_CONFIG = { }, }; -const majorVersion = parseInt(version.split('.')[0]); +const majorVersion = parseFloat(version.split('.')[0]); describe('GraphQLLanguageService', () => { const mockCache = { @@ -42,22 +47,12 @@ describe('GraphQLLanguageService', () => { }, getFragmentDefinitions() { const definitions = new Map(); + console.log(parse(`fragment TestFragment { id }`)); + const fragmentDef = parse(`fragment TestFragment { id }`)[0]; definitions.set('TestFragment', { filePath: 'fake file path', content: 'fake file content', - definition: { - kind: 'FragmentDefinition', - name: - majorVersion < 16 - ? 'TestFragment' - : { - value: 'TestFragment', - }, - loc: { - start: 293, - end: 335, - }, - }, + definition: fragmentDef, }); return definitions; },