Skip to content

Commit

Permalink
fix: try again
Browse files Browse the repository at this point in the history
  • Loading branch information
acao committed Nov 2, 2024
1 parent a117931 commit 5abf408
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pr-graphql-compat-check.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -24,7 +29,7 @@ const MOCK_CONFIG = {
},
};

const majorVersion = parseInt(version.split('.')[0]);
const majorVersion = parseFloat(version.split('.')[0]);

describe('GraphQLLanguageService', () => {
const mockCache = {
Expand All @@ -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;
},
Expand Down

0 comments on commit 5abf408

Please sign in to comment.