From 888765be3e6cbcda064bccf23c9f3f6108ee57fd Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Wed, 21 Jun 2023 09:07:54 +0200 Subject: [PATCH 1/9] fix: tests without build --- .github/workflows/pr-tests.yml | 3 - .gitignore | 1 + jest.config.base.js | 1 + .../{mocks => __mocks__}/svg.jsx | 2 +- packages/graphiql-react/jest.config.js | 2 +- .../graphiql/__mocks__/@graphiql/react.tsx | 269 ------------------ packages/graphiql/__mocks__/svg.jsx | 7 + packages/graphiql/jest.config.js | 1 + 8 files changed, 12 insertions(+), 274 deletions(-) rename packages/graphiql-react/{mocks => __mocks__}/svg.jsx (64%) delete mode 100644 packages/graphiql/__mocks__/@graphiql/react.tsx create mode 100644 packages/graphiql/__mocks__/svg.jsx diff --git a/.github/workflows/pr-tests.yml b/.github/workflows/pr-tests.yml index bd5b760bd73..76a69202b76 100644 --- a/.github/workflows/pr-tests.yml +++ b/.github/workflows/pr-tests.yml @@ -21,9 +21,6 @@ jobs: cache: 'yarn' - run: yarn install --frozen-lockfile --immutable - - name: Build - run: yarn build - - name: Run Unit Tests run: yarn test --coverage diff --git a/.gitignore b/.gitignore index a03e9f26805..369f90b700b 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ packages/**/dist/.npmignore packages/graphiql/typedoc dist esm +cjs bundle *.vsix diff --git a/jest.config.base.js b/jest.config.base.js index 4c246dfde87..511bbff698e 100644 --- a/jest.config.base.js +++ b/jest.config.base.js @@ -22,6 +22,7 @@ module.exports = (dir, env = 'jsdom') => { '\\.(css|less)$': 'identity-obj-proxy', '^graphql-language-service-([^/]+)': `${__dirname}/packages/graphql-language-service/src/$1`, '^graphql-language-([^/]+)': `${__dirname}/packages/graphql-language-$1/src`, + '^@graphiql\\/([^/]+)': `${__dirname}/packages/graphiql-$1/src`, '^@graphiql-plugins\\/([^/]+)': `${__dirname}/plugins/$1/src`, '^codemirror-graphql\\/([^]+)': `${__dirname}/packages/codemirror-graphql/src/$1`, '^example-([^/]+)': `${__dirname}/examples/$1/src`, diff --git a/packages/graphiql-react/mocks/svg.jsx b/packages/graphiql-react/__mocks__/svg.jsx similarity index 64% rename from packages/graphiql-react/mocks/svg.jsx rename to packages/graphiql-react/__mocks__/svg.jsx index 1e8dd2e1098..01a51c00970 100644 --- a/packages/graphiql-react/mocks/svg.jsx +++ b/packages/graphiql-react/__mocks__/svg.jsx @@ -1,4 +1,4 @@ -module.exports = function MockedIcon(props) { +export default function MockedIcon(props) { return ( mocked icon diff --git a/packages/graphiql-react/jest.config.js b/packages/graphiql-react/jest.config.js index d047842c0cf..22b3f1af305 100644 --- a/packages/graphiql-react/jest.config.js +++ b/packages/graphiql-react/jest.config.js @@ -3,7 +3,7 @@ const base = require('../../jest.config.base')(__dirname); module.exports = { ...base, moduleNameMapper: { - '\\.svg$': `${__dirname}/mocks/svg`, + '\\.svg$': `${__dirname}/__mocks__/svg`, ...base.moduleNameMapper, }, }; diff --git a/packages/graphiql/__mocks__/@graphiql/react.tsx b/packages/graphiql/__mocks__/@graphiql/react.tsx deleted file mode 100644 index 671964f7844..00000000000 --- a/packages/graphiql/__mocks__/@graphiql/react.tsx +++ /dev/null @@ -1,269 +0,0 @@ -import { - useEditorContext, - HeaderEditor as _HeaderEditor, - QueryEditor as _QueryEditor, - ResponseEditor as _ResponseEditor, - VariableEditor as _VariableEditor, - useHeaderEditor as _useHeaderEditor, - useQueryEditor as _useQueryEditor, - useResponseEditor as _useResponseEditor, - useVariableEditor as _useVariableEditor, -} from '@graphiql/react'; -import { useEffect, useRef, useState } from 'react'; - -export { - Argument, - ArgumentIcon, - Button, - ButtonGroup, - ChevronDownIcon, - ChevronLeftIcon, - ChevronUpIcon, - CloseIcon, - CopyIcon, - DefaultValue, - DeprecatedArgumentIcon, - DeprecatedEnumValueIcon, - DeprecatedFieldIcon, - DeprecationReason, - Dialog, - Directive, - DirectiveIcon, - DOC_EXPLORER_PLUGIN, - DocExplorer, - DocsFilledIcon, - DocsIcon, - EditorContext, - EditorContextProvider, - EnumValueIcon, - ExecuteButton, - ExecutionContext, - ExecutionContextProvider, - ExplorerContext, - ExplorerContextProvider, - ExplorerSection, - FieldDocumentation, - FieldIcon, - FieldLink, - GraphiQLProvider, - History, - HISTORY_PLUGIN, - HistoryContext, - HistoryContextProvider, - HistoryIcon, - ImagePreview, - ImplementsIcon, - KeyboardShortcutIcon, - Listbox, - MagnifyingGlassIcon, - MarkdownContent, - Menu, - MergeIcon, - PenIcon, - PlayIcon, - PluginContext, - PluginContextProvider, - PlusIcon, - PrettifyIcon, - ReloadIcon, - RootTypeIcon, - SchemaContext, - SchemaContextProvider, - SchemaDocumentation, - Search, - SettingsIcon, - Spinner, - StarFilledIcon, - StarIcon, - StopIcon, - StorageContext, - StorageContextProvider, - Tab, - Tabs, - ToolbarButton, - ToolbarListbox, - ToolbarMenu, - Tooltip, - TypeDocumentation, - TypeIcon, - TypeLink, - UnStyledButton, - useAutoCompleteLeafs, - useCopyQuery, - useDragResize, - useEditorContext, - useExecutionContext, - useExplorerContext, - useHistoryContext, - useMergeQuery, - usePluginContext, - usePrettifyEditors, - useSchemaContext, - useStorageContext, - useTheme, -} from '@graphiql/react'; - -export type { - CommonEditorProps, - EditorContextProviderProps, - EditorContextType, - ExecutionContextProviderProps, - ExecutionContextType, - ExplorerContextProviderProps, - ExplorerContextType, - ExplorerFieldDef, - ExplorerNavStack, - ExplorerNavStackItem, - GraphiQLPlugin, - GraphiQLProviderProps, - HistoryContextProviderProps, - HistoryContextType, - KeyMap, - PluginContextProviderProps, - PluginContextType, - ResponseTooltipType, - SchemaContextProviderProps, - SchemaContextType, - StorageContextProviderProps, - StorageContextType, - TabsState, - Theme, - UseHeaderEditorArgs, - UseQueryEditorArgs, - UseResponseEditorArgs, - UseVariableEditorArgs, - WriteableEditorProps, -} from '@graphiql/react'; - -type Name = 'query' | 'variable' | 'header' | 'response'; - -const NAME_TO_INITIAL_VALUE = { - query: 'initialQuery', - variable: 'initialVariables', - header: 'initialHeaders', - response: 'initialResponse', -} as const; - -function useMockedEditor(name: Name, onEdit?: (newValue: string) => void) { - const editorContext = useEditorContext({ nonNull: true }); - const [code, setCode] = useState(editorContext[NAME_TO_INITIAL_VALUE[name]]); - const ref = useRef(null); - - const setEditor = - editorContext[`set${name.slice(0, 1).toUpperCase()}${name.slice(1)}Editor`]; - - const getValueRef = useRef<() => string>(() => code); - useEffect(() => { - getValueRef.current = () => code; - }, [code]); - - useEffect(() => { - if (!ref.current) { - return; - } - - if (ref.current.childElementCount > 0) { - return; - } - - const mockGutter = document.createElement('div'); - mockGutter.className = 'CodeMirror-gutter'; - - const mockTextArea = document.createElement('textarea'); - mockTextArea.className = 'mockCodeMirror'; - - const mockWrapper = document.createElement('div'); - mockWrapper.append(mockGutter, mockTextArea); - - ref.current.append(mockWrapper); - - setEditor({ - getValue() { - return getValueRef.current(); - }, - setValue(newValue: string) { - setCode(newValue); - }, - refresh() {}, - }); - }); - - useEffect(() => { - if (!ref.current) { - return; - } - - const textarea = ref.current.querySelector('.mockCodeMirror'); - if (!(textarea instanceof HTMLTextAreaElement)) { - return; - } - - function handleChange(event: Event) { - const newValue = (event.target as HTMLTextAreaElement).value; - setCode(newValue); - onEdit?.(newValue); - } - - textarea.addEventListener('change', handleChange); - return () => textarea.removeEventListener('change', handleChange); - }, [onEdit]); - - useEffect(() => { - if (!ref.current) { - return; - } - - const textarea = ref.current.querySelector('.mockCodeMirror'); - if (!(textarea instanceof HTMLTextAreaElement)) { - return; - } - - textarea.value = code; - }, [code]); - - return ref; -} - -export const useHeaderEditor: typeof _useHeaderEditor = - function useHeaderEditor(args) { - return useMockedEditor('header', args?.onEdit); - }; - -export const useQueryEditor: typeof _useQueryEditor = function useQueryEditor( - args, -) { - return useMockedEditor('query', args?.onEdit); -}; - -export const useResponseEditor: typeof _useResponseEditor = - function useResponseEditor() { - return useMockedEditor('response'); - }; - -export const useVariableEditor: typeof _useVariableEditor = - function useVariableEditor(args) { - return useMockedEditor('variable', args?.onEdit); - }; - -export const HeaderEditor: typeof _HeaderEditor = function HeaderEditor(props) { - const ref = useHeaderEditor(props); - return
; -}; - -export const QueryEditor: typeof _QueryEditor = function QueryEditor(props) { - const ref = useQueryEditor(props); - return
; -}; - -export const ResponseEditor: typeof _ResponseEditor = - function ResponseEditor() { - const ref = useResponseEditor(); - return
; - }; - -export const VariableEditor: typeof _VariableEditor = function VariableEditor( - props, -) { - const ref = useVariableEditor(props); - return
; -}; diff --git a/packages/graphiql/__mocks__/svg.jsx b/packages/graphiql/__mocks__/svg.jsx new file mode 100644 index 00000000000..01a51c00970 --- /dev/null +++ b/packages/graphiql/__mocks__/svg.jsx @@ -0,0 +1,7 @@ +export default function MockedIcon(props) { + return ( + + mocked icon + + ); +}; diff --git a/packages/graphiql/jest.config.js b/packages/graphiql/jest.config.js index d5f2ae82f35..14488a6d73a 100644 --- a/packages/graphiql/jest.config.js +++ b/packages/graphiql/jest.config.js @@ -2,4 +2,5 @@ const base = require('../../jest.config.base')(__dirname); module.exports = { ...base, + '\\.svg$': `${__dirname}/__mocks__/svg`, }; From c2ab7bed08adaabb252eae1861ff5d2b5631ea2c Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Wed, 21 Jun 2023 11:43:49 +0200 Subject: [PATCH 2/9] fix react testing library, test mocks --- jest.config.base.js | 5 +- package.json | 2 +- packages/graphiql-react/package.json | 2 +- .../src/explorer/components/search.tsx | 2 +- packages/graphiql/__mocks__/codemirror.ts | 15 ++- packages/graphiql/jest.config.js | 5 +- packages/graphiql/package.json | 6 +- .../components/__tests__/GraphiQL.spec.tsx | 18 ++-- yarn.lock | 102 +++++++++--------- 9 files changed, 91 insertions(+), 66 deletions(-) diff --git a/jest.config.base.js b/jest.config.base.js index 511bbff698e..96168647606 100644 --- a/jest.config.base.js +++ b/jest.config.base.js @@ -24,8 +24,10 @@ module.exports = (dir, env = 'jsdom') => { '^graphql-language-([^/]+)': `${__dirname}/packages/graphql-language-$1/src`, '^@graphiql\\/([^/]+)': `${__dirname}/packages/graphiql-$1/src`, '^@graphiql-plugins\\/([^/]+)': `${__dirname}/plugins/$1/src`, - '^codemirror-graphql\\/([^]+)': `${__dirname}/packages/codemirror-graphql/src/$1`, + '^codemirror-graphql\\/esm([^]+)': `${__dirname}/packages/codemirror-graphql/src/$1`, + '^codemirror-graphql\\/cjs([^]+)': `${__dirname}/packages/codemirror-graphql/src/$1`, '^example-([^/]+)': `${__dirname}/examples/$1/src`, + '^-!svg-react-loader.*$': '/resources/jest/svgImportMock.js' }, testMatch: ['**/*[-.](spec|test).[jt]s?(x)', '!**/cypress/**'], testEnvironment: env, @@ -39,7 +41,6 @@ module.exports = (dir, env = 'jsdom') => { 'resources', 'test', 'examples', - 'graphiql-2-rfc-context', '.d.ts', 'types.ts', ], diff --git a/package.json b/package.json index d621cfcec5b..5498e0412c6 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "build": "yarn build:clean && yarn build:cm6-graphql && yarn build:packages && yarn build:graphiql-react && yarn build:graphiql-plugin-explorer && yarn build:graphiql-plugin-code-exporter && yarn build:graphiql", "build-bundles": "yarn prebuild-bundles && wsrun -p -m -s build-bundles", "build-bundles-clean": "rimraf '{packages,examples,plugins}/**/{bundle,cdn,webpack}' && yarn workspace graphiql run build-bundles-clean", - "build-clean": "wsrun -m build-clean ", + "build-clean": "wsrun -m build-clean && rimraf packages/**/{esm,cjs,dist,types}", "build-demo": "wsrun -m -s build-demo", "build-docs": "rimraf 'packages/graphiql/typedoc' && typedoc 'packages'", "build:clean": "yarn tsc --clean && yarn tsc --clean resources/tsconfig.graphiql.json", diff --git a/packages/graphiql-react/package.json b/packages/graphiql-react/package.json index 9b59c70c731..b11c06fdf27 100644 --- a/packages/graphiql-react/package.json +++ b/packages/graphiql-react/package.json @@ -65,7 +65,7 @@ }, "devDependencies": { "@babel/helper-string-parser": "^7.19.4", - "@testing-library/react": "12.1.5", + "@testing-library/react": "14.0.0", "@types/set-value": "^4.0.1", "@vitejs/plugin-react": "^4.0.0", "graphql": "^16.4.0", diff --git a/packages/graphiql-react/src/explorer/components/search.tsx b/packages/graphiql-react/src/explorer/components/search.tsx index 3c4e01ff8ea..12739399008 100644 --- a/packages/graphiql-react/src/explorer/components/search.tsx +++ b/packages/graphiql-react/src/explorer/components/search.tsx @@ -63,7 +63,7 @@ export function Search() { [push], ); const [isFocused, setIsFocused] = useState(false); - const handleFocus = useCallback(e => { + const handleFocus = useCallback((e: any) => { setIsFocused(e.type === 'focus'); }, []); diff --git a/packages/graphiql/__mocks__/codemirror.ts b/packages/graphiql/__mocks__/codemirror.ts index a70296e7ebb..592d4991330 100644 --- a/packages/graphiql/__mocks__/codemirror.ts +++ b/packages/graphiql/__mocks__/codemirror.ts @@ -21,6 +21,14 @@ function CodeMirror(node: HTMLElement, { value, ...options }) { return { options: { ...options, + lint: { + linterOptions: {} + } + }, + state: { + lint: { + linterOptions: {} + } }, on(event, handler) { @@ -46,7 +54,10 @@ function CodeMirror(node: HTMLElement, { value, ...options }) { setValue(newValue) { mockTextArea.value = newValue; }, - + addKeyMap() {}, + removeKeyMap() {}, + setOption() {}, + refresh() {}, setSize() {}, emit: _emit, @@ -56,6 +67,8 @@ function CodeMirror(node: HTMLElement, { value, ...options }) { CodeMirror.defineExtension = () => {}; CodeMirror.registerHelper = () => {}; CodeMirror.defineOption = () => {}; +CodeMirror.defineMode = () => {}; + CodeMirror.signal = (mockCodeMirror, event, ...args) => { mockCodeMirror.emit(event, ...args); }; diff --git a/packages/graphiql/jest.config.js b/packages/graphiql/jest.config.js index 14488a6d73a..22b3f1af305 100644 --- a/packages/graphiql/jest.config.js +++ b/packages/graphiql/jest.config.js @@ -2,5 +2,8 @@ const base = require('../../jest.config.base')(__dirname); module.exports = { ...base, - '\\.svg$': `${__dirname}/__mocks__/svg`, + moduleNameMapper: { + '\\.svg$': `${__dirname}/__mocks__/svg`, + ...base.moduleNameMapper, + }, }; diff --git a/packages/graphiql/package.json b/packages/graphiql/package.json index c84a6bdb31c..936dc86cf89 100644 --- a/packages/graphiql/package.json +++ b/packages/graphiql/package.json @@ -35,7 +35,7 @@ "build": "yarn build-clean && yarn build-cjs && yarn build-esm", "build-bundles": "yarn build-bundles-clean && yarn build-bundles-dev && yarn build-bundles-min", "build-bundles-clean": "rimraf 'graphiql.*{js,css}' *.html", - "build-bundles-dev": "cross-env NODE_ENV=development CDN=1 yarn webpack --mode development --bail", + "build-bundles-dev": "cross-env NODE_ENV=development BABEL_ENV=development CDN=1 yarn webpack --mode development --bail", "build-bundles-min": "cross-env ANALYZE=1 NODE_ENV=production CDN=1 yarn webpack --mode production --bail", "build-cjs": "tsc", "build-clean": "rimraf esm dist webpack *.html", @@ -61,7 +61,7 @@ "devDependencies": { "@cypress/webpack-preprocessor": "^5.5.0", "@testing-library/jest-dom": "5.16.5", - "@testing-library/react": "12.1.5", + "@testing-library/react": "14.0.0", "@types/codemirror": "^5.60.5", "@types/markdown-it": "^12.2.3", "@types/node": "^16.18.4", @@ -88,7 +88,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-hot-loader": "^4.12.20", - "react-test-renderer": "^16.13.1", + "react-test-renderer": "^18.2.0", "require-context.macro": "^1.2.2", "rimraf": "^3.0.2", "serve": "^11.3.0", diff --git a/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx b/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx index 889056bdf76..9a11281a731 100644 --- a/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx +++ b/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx @@ -44,7 +44,6 @@ beforeEach(() => { }); describe('GraphiQL', () => { - // @ts-expect-error fake Fetcher const noOpFetcher: Fetcher = () => {}; describe('fetcher', () => { @@ -166,7 +165,7 @@ describe('GraphiQL', () => { await waitFor(() => { const mockEditor = container.querySelector( - '[data-testid="query-editor"] .mockCodeMirror', + '.graphiql-query-editor .mockCodeMirror', ); expect(mockEditor.value).toContain('# Welcome to GraphiQL'); }); @@ -180,7 +179,7 @@ describe('GraphiQL', () => { await waitFor(() => { expect( container.querySelector( - '[data-testid="query-editor"] .mockCodeMirror', + '.graphiql-query-editor .mockCodeMirror', ), ).toHaveValue('GraphQL Party!!'); }); @@ -753,13 +752,18 @@ describe('GraphiQL', () => { fetcher={noOpFetcher} />, ); + await act(async () => { + try { + fireEvent.click(getByLabelText('Execute query (Ctrl-Enter)')); + fireEvent.click(getByLabelText('Show History')); + } + catch(err) { + console.error(err) + } - act(() => { - fireEvent.click(getByLabelText('Execute query (Ctrl-Enter)')); - fireEvent.click(getByLabelText('Show History')); }); - await waitFor(() => { + await waitFor(async () => { expect( container.querySelectorAll('.graphiql-history-items li'), ).toHaveLength(1); diff --git a/yarn.lock b/yarn.lock index 746cc7eed64..7a52576d825 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4277,18 +4277,18 @@ dependencies: defer-to-connect "^1.0.1" -"@testing-library/dom@^8.0.0": - version "8.19.0" - resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.19.0.tgz#bd3f83c217ebac16694329e413d9ad5fdcfd785f" - integrity sha512-6YWYPPpxG3e/xOo6HIWwB/58HukkwIVTOaZ0VwdMVjhRUX/01E4FtQbck9GazOOj7MXHc5RBzMrU86iBJHbI+A== +"@testing-library/dom@^9.0.0": + version "9.3.1" + resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-9.3.1.tgz#8094f560e9389fb973fe957af41bf766937a9ee9" + integrity sha512-0DGPd9AR3+iDTjGoMpxIkAsUihHZ3Ai6CneU6bRRrffXMgzCdlNk43jTrD2/5LT6CBb3MWTP8v510JzYtahD2w== dependencies: "@babel/code-frame" "^7.10.4" "@babel/runtime" "^7.12.5" - "@types/aria-query" "^4.2.0" - aria-query "^5.0.0" + "@types/aria-query" "^5.0.1" + aria-query "5.1.3" chalk "^4.1.0" dom-accessibility-api "^0.5.9" - lz-string "^1.4.4" + lz-string "^1.5.0" pretty-format "^27.0.2" "@testing-library/jest-dom@5.16.5": @@ -4306,14 +4306,14 @@ lodash "^4.17.15" redent "^3.0.0" -"@testing-library/react@12.1.5": - version "12.1.5" - resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-12.1.5.tgz#bb248f72f02a5ac9d949dea07279095fa577963b" - integrity sha512-OfTXCJUFgjd/digLUuPxa0+/3ZxsQmE7ub9kcbW/wi96Bh3o/p5vrETcBGfP17NWPGqeYYl5LTRpwyGoMC4ysg== +"@testing-library/react@14.0.0": + version "14.0.0" + resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-14.0.0.tgz#59030392a6792450b9ab8e67aea5f3cc18d6347c" + integrity sha512-S04gSNJbYE30TlIMLTzv6QCTzt9AqIF5y6s6SzVFILNcNvbV/jU96GeiTPillGQo+Ny64M/5PV7klNYYgv5Dfg== dependencies: "@babel/runtime" "^7.12.5" - "@testing-library/dom" "^8.0.0" - "@types/react-dom" "<18.0.0" + "@testing-library/dom" "^9.0.0" + "@types/react-dom" "^18.0.0" "@tootallnate/once@1": version "1.1.2" @@ -4332,10 +4332,10 @@ dependencies: "@types/estree" "*" -"@types/aria-query@^4.2.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.0.tgz#14264692a9d6e2fa4db3df5e56e94b5e25647ac0" - integrity sha512-iIgQNzCm0v7QMhhe4Jjn9uRh+I6GoPmt03CbEtwx3ao8/EfoQcmgtqH4vQ5Db/lxiIGaWDv6nwvunuh0RyX0+A== +"@types/aria-query@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-5.0.1.tgz#3286741fb8f1e1580ac28784add4c7a1d49bdfbc" + integrity sha512-XTIieEY+gvJ39ChLcB4If5zHtPxt3Syj5rgZR+e1ctpmK8NjPf0zFqsz4JpLJT0xla9GFDKjy8Cpu331nrmE1Q== "@types/aws-lambda@*": version "8.10.71" @@ -4787,17 +4787,17 @@ resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.3.tgz#7ee330ba7caafb98090bece86a5ee44115904c2c" integrity sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA== -"@types/react-dom@<18.0.0": - version "17.0.18" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.18.tgz#8f7af38f5d9b42f79162eea7492e5a1caff70dc2" - integrity sha512-rLVtIfbwyur2iFKykP2w0pl/1unw26b5td16d5xMgp7/yjTHomkyxPYChFoCr/FtEX1lN9wY6lFj1qvKdS5kDw== +"@types/react-dom@^18.0.0": + version "18.2.6" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.6.tgz#ad621fa71a8db29af7c31b41b2ea3d8a6f4144d1" + integrity sha512-2et4PDvg6PVCyS7fuTc4gPoksV58bW0RwSxWKcPRcHZf0PRUGq03TKcD/rUHe3azfV6/5/biUBJw+HhCQjaP0A== dependencies: - "@types/react" "^17" + "@types/react" "*" -"@types/react@^17": - version "17.0.48" - resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.48.tgz#a4532a8b91d7b27b8768b6fc0c3bccb760d15a6c" - integrity sha512-zJ6IYlJ8cYYxiJfUaZOQee4lh99mFihBoqkOSEGV+dFi9leROW6+PgstzQ+w3gWTnUfskALtQPGHK6dYmPj+2A== +"@types/react@*": + version "18.2.13" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.13.tgz#a98c09bde8b18f80021935b11d2d29ef5f4dcb2f" + integrity sha512-vJ+zElvi/Zn9cVXB5slX2xL8PZodPCwPRDpittQdw43JR2AJ5k3vKdgJJyneV/cYgIbLQUwXa9JVDvUZXGba+Q== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" @@ -5797,7 +5797,7 @@ aria-hidden@^1.1.1: dependencies: tslib "^2.0.0" -aria-query@^5.0.0: +aria-query@5.1.3, aria-query@^5.0.0: version "5.1.3" resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.1.3.tgz#19db27cd101152773631396f7a95a3b58c22c35e" integrity sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ== @@ -12716,10 +12716,10 @@ lunr@^2.3.9: resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow== -lz-string@^1.4.4: - version "1.4.4" - resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26" - integrity sha512-0ckx7ZHRPqb0oUm8zNr+90mtf9DQB60H1wMCjBtfi62Kl3a7JbHob6gA2bC+xRvZoOL+1hzUK8jeuEIQE8svEQ== +lz-string@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.5.0.tgz#c1ab50f77887b712621201ba9fd4e3a6ed099941" + integrity sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ== magic-string@^0.25.7: version "0.25.9" @@ -15125,7 +15125,7 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" -prop-types@15.7.2, prop-types@^15.6.1, prop-types@^15.6.2: +prop-types@15.7.2, prop-types@^15.6.1: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== @@ -15320,7 +15320,12 @@ react-hot-loader@^4.12.20: shallowequal "^1.1.0" source-map "^0.7.3" -react-is@^16.13.1, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.6: +"react-is@^16.12.0 || ^17.0.0 || ^18.0.0", react-is@^18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" + integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== + +react-is@^16.13.1, react-is@^16.7.0, react-is@^16.8.1: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== @@ -15364,6 +15369,14 @@ react-remove-scroll@2.5.5: use-callback-ref "^1.3.0" use-sidecar "^1.1.2" +react-shallow-renderer@^16.15.0: + version "16.15.0" + resolved "https://registry.yarnpkg.com/react-shallow-renderer/-/react-shallow-renderer-16.15.0.tgz#48fb2cf9b23d23cde96708fe5273a7d3446f4457" + integrity sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA== + dependencies: + object-assign "^4.1.1" + react-is "^16.12.0 || ^17.0.0 || ^18.0.0" + react-style-singleton@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/react-style-singleton/-/react-style-singleton-2.2.1.tgz#f99e420492b2d8f34d38308ff660b60d0b1205b4" @@ -15373,15 +15386,14 @@ react-style-singleton@^2.2.1: invariant "^2.2.4" tslib "^2.0.0" -react-test-renderer@^16.13.1: - version "16.14.0" - resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.14.0.tgz#e98360087348e260c56d4fe2315e970480c228ae" - integrity sha512-L8yPjqPE5CZO6rKsKXRO/rVPiaCOy0tQQJbC+UjPNlobl5mad59lvPjwFsQHTvL03caVDIVr9x9/OSgDe6I5Eg== +react-test-renderer@^18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-18.2.0.tgz#1dd912bd908ff26da5b9fca4fd1c489b9523d37e" + integrity sha512-JWD+aQ0lh2gvh4NM3bBM42Kx+XybOxCpgYK7F8ugAlpaTSnWsX+39Z4XkOykGZAHrjwwTZT3x3KxswVWxHPUqA== dependencies: - object-assign "^4.1.1" - prop-types "^15.6.2" - react-is "^16.8.6" - scheduler "^0.19.1" + react-is "^18.2.0" + react-shallow-renderer "^16.15.0" + scheduler "^0.23.0" react@^18.2.0: version "18.2.0" @@ -16003,14 +16015,6 @@ saxes@^5.0.1: dependencies: xmlchars "^2.2.0" -scheduler@^0.19.1: - version "0.19.1" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196" - integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA== - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - scheduler@^0.23.0: version "0.23.0" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe" From f078d1a9c93dabbf3cf00e82f37ff15fe26d4164 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Wed, 21 Jun 2023 12:24:56 +0200 Subject: [PATCH 3/9] remove console log --- .../graphiql/src/components/__tests__/GraphiQL.spec.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx b/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx index 9a11281a731..fcae595b6ac 100644 --- a/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx +++ b/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx @@ -753,13 +753,9 @@ describe('GraphiQL', () => { />, ); await act(async () => { - try { fireEvent.click(getByLabelText('Execute query (Ctrl-Enter)')); fireEvent.click(getByLabelText('Show History')); - } - catch(err) { - console.error(err) - } + }); From 1ed4ef7dfeb0fe93871885c337afc1a201fe4a60 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Wed, 21 Jun 2023 13:09:55 +0200 Subject: [PATCH 4/9] move history unit tests to e2e --- packages/graphiql/cypress.config.ts | 2 + packages/graphiql/cypress/e2e/docs.cy.ts | 2 +- packages/graphiql/cypress/e2e/errors.cy.ts | 6 +- packages/graphiql/cypress/e2e/history.cy.ts | 189 ++++++++++++ packages/graphiql/cypress/e2e/init.cy.ts | 4 +- packages/graphiql/cypress/e2e/keyboard.cy.ts | 4 +- packages/graphiql/cypress/e2e/tabs.cy.ts | 2 +- .../fixtures}/fixtures.ts | 0 .../components/__tests__/GraphiQL.spec.tsx | 284 +----------------- packages/graphiql/test/e2e-server.js | 1 + 10 files changed, 202 insertions(+), 292 deletions(-) create mode 100644 packages/graphiql/cypress/e2e/history.cy.ts rename packages/graphiql/{src/components/__tests__ => cypress/fixtures}/fixtures.ts (100%) diff --git a/packages/graphiql/cypress.config.ts b/packages/graphiql/cypress.config.ts index 8a6e81b3d04..959caab2621 100644 --- a/packages/graphiql/cypress.config.ts +++ b/packages/graphiql/cypress.config.ts @@ -5,4 +5,6 @@ export default defineConfig({ baseUrl: 'http://localhost:8080', }, video: false, + viewportWidth: 1920, + viewportHeight: 1080 }); diff --git a/packages/graphiql/cypress/e2e/docs.cy.ts b/packages/graphiql/cypress/e2e/docs.cy.ts index fe0d033f6f7..249299e16d5 100644 --- a/packages/graphiql/cypress/e2e/docs.cy.ts +++ b/packages/graphiql/cypress/e2e/docs.cy.ts @@ -1,7 +1,7 @@ import { version } from 'graphql/version'; beforeEach(() => { - cy.visit('/'); + cy.visit(''); }); describe('GraphiQL DocExplorer - button', () => { diff --git a/packages/graphiql/cypress/e2e/errors.cy.ts b/packages/graphiql/cypress/e2e/errors.cy.ts index 0509e320bee..896b29b046c 100644 --- a/packages/graphiql/cypress/e2e/errors.cy.ts +++ b/packages/graphiql/cypress/e2e/errors.cy.ts @@ -2,7 +2,7 @@ import { version } from 'graphql'; describe('Errors', () => { it('Should show an error when the HTTP request fails', () => { - cy.visit('/?http-error=true'); + cy.visit('?http-error=true'); cy.assertQueryResult({ errors: [ { @@ -21,14 +21,14 @@ describe('Errors', () => { }); it('Should show an error when introspection fails', () => { - cy.visit('/?graphql-error=true'); + cy.visit('?graphql-error=true'); cy.assertQueryResult({ errors: [{ message: 'Something unexpected happened...' }], }); }); it('Should show an error when the schema is invalid', () => { - cy.visit('/?bad=true'); + cy.visit('?bad=true'); /** * We can't use `cy.assertQueryResult` here because the stack contains line * and column numbers of the `graphiql.min.js` bundle which are not stable. diff --git a/packages/graphiql/cypress/e2e/history.cy.ts b/packages/graphiql/cypress/e2e/history.cy.ts new file mode 100644 index 00000000000..0fbd7cc853e --- /dev/null +++ b/packages/graphiql/cypress/e2e/history.cy.ts @@ -0,0 +1,189 @@ +import { + mockQuery1, + mockVariables1, + mockOperationName1, + mockBadQuery, + mockQuery2, + mockVariables2, + mockHeaders1, + mockHeaders2, +} from '../fixtures/fixtures'; + +describe('history', () => { + beforeEach(() => { + + }); + it('defaults to closed history panel', () => { + cy.visit(''); + + cy.get('.graphiql-history').should('not.exist'); + }); + + it('will save history item even when history panel is closed', () => { + cy.visit('?query={test}'); + cy.clickExecuteQuery(); + cy.get('button[aria-label="Show History"]').click(); + cy.get('ul.graphiql-history-items').should('have.length', 1); + }); + + it('will save history item even when history panel is closed', () => { + cy.visit('?query={test}'); + cy.clickExecuteQuery(); + cy.get('button[aria-label="Show History"]').click(); + cy.get('ul.graphiql-history-items li').should('have.length', 1); + }); + + it('will not save invalid queries', () => { + cy.visit(`?query=${mockBadQuery}`); + cy.get('button[aria-label="Show History"]').click(); + cy.clickExecuteQuery(); + cy.get('ul.graphiql-history-items li').should('have.length', 0); + }); + + it('will save if new query is different than previous query', () => { + cy.visit(`?query=${mockQuery1}&headers=${mockHeaders1}`); + cy.get('button[aria-label="Show History"]').click(); + cy.clickExecuteQuery(); + cy.get('ul.graphiql-history-items li').should('have.length', 1); + + cy.visit(`?query=${mockQuery2}&headers=${mockHeaders1}`); + cy.clickExecuteQuery(); + cy.get('button[aria-label="Show History"]').click(); + cy.get('ul.graphiql-history-items li').should('have.length', 2); + }); + + it('will not save if new query is the same as previous query', () => { + cy.visit(`?query=${mockQuery1}&headers=${mockHeaders1}`); + cy.get('button[aria-label="Show History"]').click(); + cy.clickExecuteQuery(); + cy.get('ul.graphiql-history-items li').should('have.length', 1); + + cy.visit(`?query=${mockQuery1}&headers=${mockHeaders1}`); + cy.clickExecuteQuery(); + cy.get('button[aria-label="Show History"]').click(); + cy.get('ul.graphiql-history-items li').should('have.length', 1); + }); + + it('will save query if the variables change', () => { + cy.visit(`?query=${mockQuery1}&headers=${mockHeaders1}&variables=${mockVariables1}`); + cy.get('button[aria-label="Show History"]').click(); + cy.clickExecuteQuery(); + cy.get('ul.graphiql-history-items li').should('have.length', 1); + + cy.visit(`?query=${mockQuery1}&headers=${mockHeaders1}&variables=${mockVariables2}`); + cy.clickExecuteQuery(); + cy.get('button[aria-label="Show History"]').click(); + cy.get('ul.graphiql-history-items li').should('have.length', 2); + }); + + it('will save query if the headers change', () => { + cy.visit(`?query=${mockQuery1}&headers=${mockHeaders1}`); + cy.get('button[aria-label="Show History"]').click(); + cy.clickExecuteQuery(); + cy.get('ul.graphiql-history-items li').should('have.length', 1); + + cy.visit(`?query=${mockQuery1}&headers=${mockHeaders2}`); + cy.clickExecuteQuery(); + cy.get('button[aria-label="Show History"]').click(); + cy.get('ul.graphiql-history-items li').should('have.length', 2); + }); + + // it('will save query if variables are different', async () => { + // const { getByLabelText, container } = render( + // , + // ); + + // act(() => { + // fireEvent.click(getByLabelText('Show History')); + // }); + + // const executeQueryButton = getByLabelText('Execute query (Ctrl-Enter)'); + + // act(() => { + // fireEvent.click(executeQueryButton); + // }); + + // await waitFor(() => { + // expect( + // container.querySelectorAll('.graphiql-history-item'), + // ).toHaveLength(1); + // }); + + // act(() => { + // fireEvent.change( + // container.querySelector('[aria-label="Variables"] .mockCodeMirror'), + // { + // target: { value: mockVariables2 }, + // }, + // ); + // }); + + // act(() => { + // fireEvent.click(executeQueryButton); + // }); + + // await waitFor(() => { + // expect( + // container.querySelectorAll('.graphiql-history-item'), + // ).toHaveLength(2); + // }); + // }); + + // it('will save query if headers are different', async () => { + // const { getByLabelText, getByText, container } = render( + // , + // ); + + // act(() => { + // fireEvent.click(getByLabelText('Show History')); + // }); + + // const executeQueryButton = getByLabelText('Execute query (Ctrl-Enter)'); + + // act(() => { + // fireEvent.click(executeQueryButton); + // }); + + // await waitFor(() => { + // expect( + // container.querySelectorAll('.graphiql-history-item'), + // ).toHaveLength(1); + // }); + + // act(() => { + // fireEvent.click(getByText('Headers')); + // }); + + // act(() => { + // fireEvent.change( + // container.querySelector('[aria-label="Headers"] .mockCodeMirror'), + // { + // target: { value: mockHeaders2 }, + // }, + // ); + // }); + + // act(() => { + // fireEvent.click(executeQueryButton); + // }); + + // await waitFor(() => { + // expect( + // container.querySelectorAll('.graphiql-history-item'), + // ).toHaveLength(2); + // }); + // }); +}); // history diff --git a/packages/graphiql/cypress/e2e/init.cy.ts b/packages/graphiql/cypress/e2e/init.cy.ts index 960faecd627..379d5aeb99f 100644 --- a/packages/graphiql/cypress/e2e/init.cy.ts +++ b/packages/graphiql/cypress/e2e/init.cy.ts @@ -36,7 +36,7 @@ describe('GraphiQL On Initialization', () => { '.graphiql-response', '.graphiql-editor-tool', ]; - cy.visit('/'); + cy.visit(''); cy.get('.graphiql-query-editor').contains('# Welcome to GraphiQL'); for (const cSelector of containers) { cy.get(cSelector).should('be.visible'); @@ -49,7 +49,7 @@ describe('GraphiQL On Initialization', () => { cy.assertQueryResult(mockSuccess); }); it('Shows the expected error when the schema is invalid', () => { - cy.visit('/?bad=true'); + cy.visit('?bad=true'); cy.get('section.result-window').should(element => { expect(element.get(0).innerText).to.contain('Names must'); }); diff --git a/packages/graphiql/cypress/e2e/keyboard.cy.ts b/packages/graphiql/cypress/e2e/keyboard.cy.ts index 0883b102eca..82a12df84c6 100644 --- a/packages/graphiql/cypress/e2e/keyboard.cy.ts +++ b/packages/graphiql/cypress/e2e/keyboard.cy.ts @@ -1,6 +1,6 @@ describe('GraphiQL keyboard interactions', () => { it('Does not prevent the escape key from being handled outside the editor', () => { - cy.visit('/'); + cy.visit(''); const mockFn = cy.stub().as('escapeHandler'); cy.document().then(doc => { doc.addEventListener('keydown', event => { @@ -16,7 +16,7 @@ describe('GraphiQL keyboard interactions', () => { }); it('Does prevent the escape key from being handled outside the editor if closing the autocomplete dialog', () => { - cy.visit('/'); + cy.visit(''); const mockFn = cy.stub().as('escapeHandler'); cy.document().then(doc => { doc.addEventListener('keydown', event => { diff --git a/packages/graphiql/cypress/e2e/tabs.cy.ts b/packages/graphiql/cypress/e2e/tabs.cy.ts index 4ad14f76d14..a531938213b 100644 --- a/packages/graphiql/cypress/e2e/tabs.cy.ts +++ b/packages/graphiql/cypress/e2e/tabs.cy.ts @@ -1,6 +1,6 @@ describe('Tabs', () => { it('Should store editor contents when switching between tabs', () => { - cy.visit('/?query='); + cy.visit('?query='); // Assert that no tab visible when there's only one session cy.get('#graphiql-session-tab-0').should('not.exist'); diff --git a/packages/graphiql/src/components/__tests__/fixtures.ts b/packages/graphiql/cypress/fixtures/fixtures.ts similarity index 100% rename from packages/graphiql/src/components/__tests__/fixtures.ts rename to packages/graphiql/cypress/fixtures/fixtures.ts diff --git a/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx b/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx index fcae595b6ac..ff066748bc6 100644 --- a/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx +++ b/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx @@ -178,9 +178,7 @@ describe('GraphiQL', () => { await waitFor(() => { expect( - container.querySelector( - '.graphiql-query-editor .mockCodeMirror', - ), + container.querySelector('.graphiql-query-editor .mockCodeMirror'), ).toHaveValue('GraphQL Party!!'); }); }); @@ -730,284 +728,4 @@ describe('GraphiQL', () => { }); }); }); - - describe('history', () => { - it('defaults to closed history panel', async () => { - const { container } = render(); - - await waitFor(() => { - expect( - container.querySelector('.graphiql-history'), - ).not.toBeInTheDocument(); - }); - }); - - it('will save history item even when history panel is closed', async () => { - const { getByLabelText, container } = render( - , - ); - await act(async () => { - fireEvent.click(getByLabelText('Execute query (Ctrl-Enter)')); - fireEvent.click(getByLabelText('Show History')); - - - }); - - await waitFor(async () => { - expect( - container.querySelectorAll('.graphiql-history-items li'), - ).toHaveLength(1); - }); - }); - - it('adds a history item when the execute query function button is clicked', async () => { - const { getByLabelText, container } = render( - , - ); - - act(() => { - fireEvent.click(getByLabelText('Show History')); - fireEvent.click(getByLabelText('Execute query (Ctrl-Enter)')); - }); - - await waitFor(() => { - expect( - container.querySelectorAll('.graphiql-history-items li'), - ).toHaveLength(1); - }); - }); - - it('will not save invalid queries', async () => { - const { getByLabelText, container } = render( - , - ); - - act(() => { - fireEvent.click(getByLabelText('Show History')); - fireEvent.click(getByLabelText('Execute query (Ctrl-Enter)')); - }); - - await waitFor(() => { - expect( - container.querySelectorAll('.graphiql-history-items li'), - ).toHaveLength(0); - }); - }); - - it('will save if there was not a previously saved query', async () => { - const { getByLabelText, container } = render( - , - ); - - act(() => { - fireEvent.click(getByLabelText('Show History')); - fireEvent.click(getByLabelText('Execute query (Ctrl-Enter)')); - }); - - await waitFor(() => { - expect( - container.querySelectorAll('.graphiql-history-items li'), - ).toHaveLength(1); - }); - }); - - it('will not save a query if the query is the same as previous query', async () => { - const { getByLabelText, findByLabelText, container } = render( - , - ); - - act(() => { - fireEvent.click(getByLabelText('Show History')); - fireEvent.click(getByLabelText('Execute query (Ctrl-Enter)')); - }); - - await waitFor(() => { - expect( - container.querySelectorAll('.graphiql-history-items li'), - ).toHaveLength(1); - }); - - await act(async () => { - fireEvent.click(await findByLabelText('Execute query (Ctrl-Enter)')); - }); - - await waitFor(() => { - expect( - container.querySelectorAll('.graphiql-history-items li'), - ).toHaveLength(1); - }); - }); - - it('will save if new query is different than previous query', async () => { - const { getByLabelText, container } = render( - , - ); - - act(() => { - fireEvent.click(getByLabelText('Show History')); - }); - - const executeQueryButton = getByLabelText('Execute query (Ctrl-Enter)'); - - act(() => { - fireEvent.click(executeQueryButton); - }); - - await waitFor(() => { - expect( - container.querySelectorAll('.graphiql-history-item'), - ).toHaveLength(1); - }); - - act(() => { - fireEvent.change( - container.querySelector( - '[data-testid="query-editor"] .mockCodeMirror', - ), - { - target: { value: mockQuery2 }, - }, - ); - }); - - act(() => { - fireEvent.click(executeQueryButton); - }); - - await waitFor(() => { - expect( - container.querySelectorAll('.graphiql-history-item'), - ).toHaveLength(2); - }); - }); - - it('will save query if variables are different', async () => { - const { getByLabelText, container } = render( - , - ); - - act(() => { - fireEvent.click(getByLabelText('Show History')); - }); - - const executeQueryButton = getByLabelText('Execute query (Ctrl-Enter)'); - - act(() => { - fireEvent.click(executeQueryButton); - }); - - await waitFor(() => { - expect( - container.querySelectorAll('.graphiql-history-item'), - ).toHaveLength(1); - }); - - act(() => { - fireEvent.change( - container.querySelector('[aria-label="Variables"] .mockCodeMirror'), - { - target: { value: mockVariables2 }, - }, - ); - }); - - act(() => { - fireEvent.click(executeQueryButton); - }); - - await waitFor(() => { - expect( - container.querySelectorAll('.graphiql-history-item'), - ).toHaveLength(2); - }); - }); - - it('will save query if headers are different', async () => { - const { getByLabelText, getByText, container } = render( - , - ); - - act(() => { - fireEvent.click(getByLabelText('Show History')); - }); - - const executeQueryButton = getByLabelText('Execute query (Ctrl-Enter)'); - - act(() => { - fireEvent.click(executeQueryButton); - }); - - await waitFor(() => { - expect( - container.querySelectorAll('.graphiql-history-item'), - ).toHaveLength(1); - }); - - act(() => { - fireEvent.click(getByText('Headers')); - }); - - act(() => { - fireEvent.change( - container.querySelector('[aria-label="Headers"] .mockCodeMirror'), - { - target: { value: mockHeaders2 }, - }, - ); - }); - - act(() => { - fireEvent.click(executeQueryButton); - }); - - await waitFor(() => { - expect( - container.querySelectorAll('.graphiql-history-item'), - ).toHaveLength(2); - }); - }); - }); // history }); diff --git a/packages/graphiql/test/e2e-server.js b/packages/graphiql/test/e2e-server.js index e54ce410ddd..2526c4b9cbc 100644 --- a/packages/graphiql/test/e2e-server.js +++ b/packages/graphiql/test/e2e-server.js @@ -41,6 +41,7 @@ app.post('/graphql-error/graphql', (_req, res, next) => { }); app.use(express.static(path.resolve(__dirname, '../'))); +app.use('index.html', express.static(path.resolve(__dirname, '../dev.html'))) app.listen(process.env.PORT || 0, function () { const { port } = this.address(); From c614b412101000bca1d7bdddaa26b9d55eeb807a Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Wed, 21 Jun 2023 13:48:00 +0200 Subject: [PATCH 5/9] fix: make cm6-graphql run seperately for now --- jest.config.base.js | 4 +++- package.json | 6 +++--- packages/cm6-graphql/__tests__/test.spec.ts | 2 +- packages/cm6-graphql/jest.config.js | 4 +++- packages/cm6-graphql/package.json | 3 ++- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/jest.config.base.js b/jest.config.base.js index 96168647606..da5d4cf16a8 100644 --- a/jest.config.base.js +++ b/jest.config.base.js @@ -26,12 +26,14 @@ module.exports = (dir, env = 'jsdom') => { '^@graphiql-plugins\\/([^/]+)': `${__dirname}/plugins/$1/src`, '^codemirror-graphql\\/esm([^]+)': `${__dirname}/packages/codemirror-graphql/src/$1`, '^codemirror-graphql\\/cjs([^]+)': `${__dirname}/packages/codemirror-graphql/src/$1`, + // relies on compilation + // '^cm6-graphql\\/([^]+)': `${__dirname}/packages/cm6-graphql/src/$1`, '^example-([^/]+)': `${__dirname}/examples/$1/src`, '^-!svg-react-loader.*$': '/resources/jest/svgImportMock.js' }, testMatch: ['**/*[-.](spec|test).[jt]s?(x)', '!**/cypress/**'], testEnvironment: env, - testPathIgnorePatterns: ['node_modules', 'dist', 'cypress'], + testPathIgnorePatterns: ['node_modules', 'dist', 'cypress', 'packages/cm6-graphql'], collectCoverageFrom: ['**/src/**/*.{js,jsx,ts,tsx}'], coveragePathIgnorePatterns: [ 'dist', diff --git a/package.json b/package.json index 5498e0412c6..9dc3302b90e 100644 --- a/package.json +++ b/package.json @@ -73,11 +73,11 @@ "repo:resolve": "node scripts/set-resolution.js", "start-graphiql": "yarn workspace graphiql dev", "start-monaco": "yarn workspace example-monaco-graphql-webpack start", - "t": "yarn run testonly", - "test": "yarn jest --noStackTrace", + "t": "yarn run test", + "test": "yarn jest", + "test:ci": "yarn test && yarn workspace cm6-graphql test", "test:coverage": "yarn jest --coverage", "test:watch": "yarn jest --watch", - "testonly": "jest && yarn workspace codemirror-graphql run test", "tsc": "tsc --build" }, "devDependencies": { diff --git a/packages/cm6-graphql/__tests__/test.spec.ts b/packages/cm6-graphql/__tests__/test.spec.ts index a16d1ce446b..8689527141a 100644 --- a/packages/cm6-graphql/__tests__/test.spec.ts +++ b/packages/cm6-graphql/__tests__/test.spec.ts @@ -1,5 +1,5 @@ /* eslint-disable jest/expect-expect */ -import { graphqlLanguage } from '../dist/index.js'; +import { graphqlLanguage } from '../dist'; import { fileTests } from '@lezer/generator/dist/test'; import * as fs from 'node:fs'; diff --git a/packages/cm6-graphql/jest.config.js b/packages/cm6-graphql/jest.config.js index 898accfaaa3..8257e2b06f4 100644 --- a/packages/cm6-graphql/jest.config.js +++ b/packages/cm6-graphql/jest.config.js @@ -2,5 +2,7 @@ const base = require('../../jest.config.base')(__dirname); module.exports = { ...base, - transformIgnorePatterns: ['/node_modules/(?!@lezer)'], + transformIgnorePatterns: [ + '/node_modules/(?!@lezer)', + ], }; diff --git a/packages/cm6-graphql/package.json b/packages/cm6-graphql/package.json index f608aee17c9..9afd8ed44c4 100644 --- a/packages/cm6-graphql/package.json +++ b/packages/cm6-graphql/package.json @@ -4,7 +4,8 @@ "description": "GraphQL language support for CodeMirror 6", "scripts": { "build": "cm-buildhelper src/index.ts", - "prepare": "yarn build" + "prepare": "yarn build", + "test": "yarn build && yarn test" }, "main": "dist/index.cjs", "module": "dist/index.js", From fb24e19525ba6fc6426ca13660070f9f8ee21627 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Wed, 21 Jun 2023 14:15:27 +0200 Subject: [PATCH 6/9] fix lint issues --- packages/graphiql/cypress/e2e/history.cy.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/graphiql/cypress/e2e/history.cy.ts b/packages/graphiql/cypress/e2e/history.cy.ts index 0fbd7cc853e..dfadc746df7 100644 --- a/packages/graphiql/cypress/e2e/history.cy.ts +++ b/packages/graphiql/cypress/e2e/history.cy.ts @@ -1,7 +1,6 @@ import { mockQuery1, mockVariables1, - mockOperationName1, mockBadQuery, mockQuery2, mockVariables2, From 0256ed7e369faca2bf13910ee2075975227f9884 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Wed, 21 Jun 2023 14:20:04 +0200 Subject: [PATCH 7/9] fix ci --- .github/workflows/pr-graphql-compat-check.yml | 5 +---- .github/workflows/pr-tests.yml | 2 +- .../src/components/__tests__/GraphiQL.spec.tsx | 10 ---------- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pr-graphql-compat-check.yml b/.github/workflows/pr-graphql-compat-check.yml index dac6289c41c..d27a2705b19 100644 --- a/.github/workflows/pr-graphql-compat-check.yml +++ b/.github/workflows/pr-graphql-compat-check.yml @@ -38,11 +38,8 @@ jobs: - run: yarn install --frozen-lockfile --immutable - - name: Typescript Build - run: yarn build - - name: Unit Tests - run: yarn test + run: yarn test:ci - name: Cypress run: yarn e2e diff --git a/.github/workflows/pr-tests.yml b/.github/workflows/pr-tests.yml index 76a69202b76..ce2d6d166fd 100644 --- a/.github/workflows/pr-tests.yml +++ b/.github/workflows/pr-tests.yml @@ -22,7 +22,7 @@ jobs: - run: yarn install --frozen-lockfile --immutable - name: Run Unit Tests - run: yarn test --coverage + run: yarn test:ci --coverage - uses: codecov/codecov-action@v3 with: diff --git a/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx b/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx index ff066748bc6..db45ffe7239 100644 --- a/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx +++ b/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx @@ -11,16 +11,6 @@ import { GraphiQL } from '../GraphiQL'; import { Fetcher } from '@graphiql/toolkit'; import { ToolbarButton } from '@graphiql/react'; -import { - mockQuery1, - mockVariables1, - mockOperationName1, - mockBadQuery, - mockQuery2, - mockVariables2, - mockHeaders1, - mockHeaders2, -} from './fixtures'; // The smallest possible introspection result that builds a schema. const simpleIntrospection = { From 9940064d7fa459c60c83715e3b664875d3bdc452 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Wed, 21 Jun 2023 15:07:55 +0200 Subject: [PATCH 8/9] fix: local jest no cm6, ci with cm6 --- jest.config.base.js | 4 +- package.json | 8 +- packages/cm6-graphql/__tests__/test.spec.ts | 2 +- packages/cm6-graphql/jest.config.js | 3 + packages/cm6-graphql/package.json | 3 +- .../src/explorer/components/search.tsx | 4 +- packages/graphiql/cypress/e2e/docs.cy.ts | 2 +- packages/graphiql/cypress/e2e/errors.cy.ts | 6 +- packages/graphiql/cypress/e2e/history.cy.ts | 106 +--- packages/graphiql/cypress/e2e/init.cy.ts | 4 +- packages/graphiql/cypress/e2e/keyboard.cy.ts | 4 +- packages/graphiql/cypress/e2e/tabs.cy.ts | 2 +- .../graphql-language-service-cli/package.json | 1 + yarn.lock | 566 ++++++++---------- 14 files changed, 285 insertions(+), 430 deletions(-) diff --git a/jest.config.base.js b/jest.config.base.js index da5d4cf16a8..6aa4d799c85 100644 --- a/jest.config.base.js +++ b/jest.config.base.js @@ -27,13 +27,13 @@ module.exports = (dir, env = 'jsdom') => { '^codemirror-graphql\\/esm([^]+)': `${__dirname}/packages/codemirror-graphql/src/$1`, '^codemirror-graphql\\/cjs([^]+)': `${__dirname}/packages/codemirror-graphql/src/$1`, // relies on compilation - // '^cm6-graphql\\/([^]+)': `${__dirname}/packages/cm6-graphql/src/$1`, + '^cm6-graphql\\/src\\/([^]+)': `${__dirname}/packages/cm6-graphql/dist/$1`, '^example-([^/]+)': `${__dirname}/examples/$1/src`, '^-!svg-react-loader.*$': '/resources/jest/svgImportMock.js' }, testMatch: ['**/*[-.](spec|test).[jt]s?(x)', '!**/cypress/**'], testEnvironment: env, - testPathIgnorePatterns: ['node_modules', 'dist', 'cypress', 'packages/cm6-graphql'], + testPathIgnorePatterns: ['node_modules', 'dist', 'cypress'], collectCoverageFrom: ['**/src/**/*.{js,jsx,ts,tsx}'], coveragePathIgnorePatterns: [ 'dist', diff --git a/package.json b/package.json index 9dc3302b90e..b8802ad2b5a 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "build": "yarn build:clean && yarn build:cm6-graphql && yarn build:packages && yarn build:graphiql-react && yarn build:graphiql-plugin-explorer && yarn build:graphiql-plugin-code-exporter && yarn build:graphiql", "build-bundles": "yarn prebuild-bundles && wsrun -p -m -s build-bundles", "build-bundles-clean": "rimraf '{packages,examples,plugins}/**/{bundle,cdn,webpack}' && yarn workspace graphiql run build-bundles-clean", - "build-clean": "wsrun -m build-clean && rimraf packages/**/{esm,cjs,dist,types}", + "build-clean": "wsrun -m build-clean", "build-demo": "wsrun -m -s build-demo", "build-docs": "rimraf 'packages/graphiql/typedoc' && typedoc 'packages'", "build:clean": "yarn tsc --clean && yarn tsc --clean resources/tsconfig.graphiql.json", @@ -54,7 +54,7 @@ "e2e:build": "yarn build && yarn workspace graphiql build-bundles-min", "eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --max-warnings=0 --cache .", "format": "yarn eslint --fix && yarn pretty", - "jest": "jest", + "jest": "jest --testPathIgnorePatterns cm6-graphql", "license-check": "jsgl --local ./", "lint": "yarn eslint && yarn lint-check && yarn pretty-check && yarn lint-cspell", "lint-check": "eslint-config-prettier .eslintrc.js", @@ -75,7 +75,7 @@ "start-monaco": "yarn workspace example-monaco-graphql-webpack start", "t": "yarn run test", "test": "yarn jest", - "test:ci": "yarn test && yarn workspace cm6-graphql test", + "test:ci": "yarn build:cm6-graphql && jest", "test:coverage": "yarn jest --coverage", "test:watch": "yarn jest --watch", "tsc": "tsc --build" @@ -100,7 +100,7 @@ "@types/codemirror": "^0.0.90", "@types/express": "^4.17.11", "@types/fetch-mock": "^7.3.2", - "@types/jest": "^26.0.22", + "@types/jest": "^29.5.2", "@types/node": "^16.18.4", "@types/prettier": "^2.7.0", "@types/ws": "^7.4.0", diff --git a/packages/cm6-graphql/__tests__/test.spec.ts b/packages/cm6-graphql/__tests__/test.spec.ts index 8689527141a..a16d1ce446b 100644 --- a/packages/cm6-graphql/__tests__/test.spec.ts +++ b/packages/cm6-graphql/__tests__/test.spec.ts @@ -1,5 +1,5 @@ /* eslint-disable jest/expect-expect */ -import { graphqlLanguage } from '../dist'; +import { graphqlLanguage } from '../dist/index.js'; import { fileTests } from '@lezer/generator/dist/test'; import * as fs from 'node:fs'; diff --git a/packages/cm6-graphql/jest.config.js b/packages/cm6-graphql/jest.config.js index 8257e2b06f4..2739d279edf 100644 --- a/packages/cm6-graphql/jest.config.js +++ b/packages/cm6-graphql/jest.config.js @@ -1,5 +1,8 @@ const base = require('../../jest.config.base')(__dirname); +// remove the ignore line for cm6-graphql +base.testPathIgnorePatterns.pop() + module.exports = { ...base, transformIgnorePatterns: [ diff --git a/packages/cm6-graphql/package.json b/packages/cm6-graphql/package.json index 9afd8ed44c4..f608aee17c9 100644 --- a/packages/cm6-graphql/package.json +++ b/packages/cm6-graphql/package.json @@ -4,8 +4,7 @@ "description": "GraphQL language support for CodeMirror 6", "scripts": { "build": "cm-buildhelper src/index.ts", - "prepare": "yarn build", - "test": "yarn build && yarn test" + "prepare": "yarn build" }, "main": "dist/index.cjs", "module": "dist/index.js", diff --git a/packages/graphiql-react/src/explorer/components/search.tsx b/packages/graphiql-react/src/explorer/components/search.tsx index 12739399008..474d89d3bf0 100644 --- a/packages/graphiql-react/src/explorer/components/search.tsx +++ b/packages/graphiql-react/src/explorer/components/search.tsx @@ -7,7 +7,7 @@ import { isInterfaceType, isObjectType, } from 'graphql'; -import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { FocusEventHandler, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { Combobox } from '@headlessui/react'; import { MagnifyingGlassIcon } from '../../icons'; import { useSchemaContext } from '../../schema'; @@ -63,7 +63,7 @@ export function Search() { [push], ); const [isFocused, setIsFocused] = useState(false); - const handleFocus = useCallback((e: any) => { + const handleFocus: FocusEventHandler = useCallback((e) => { setIsFocused(e.type === 'focus'); }, []); diff --git a/packages/graphiql/cypress/e2e/docs.cy.ts b/packages/graphiql/cypress/e2e/docs.cy.ts index 249299e16d5..fe0d033f6f7 100644 --- a/packages/graphiql/cypress/e2e/docs.cy.ts +++ b/packages/graphiql/cypress/e2e/docs.cy.ts @@ -1,7 +1,7 @@ import { version } from 'graphql/version'; beforeEach(() => { - cy.visit(''); + cy.visit('/'); }); describe('GraphiQL DocExplorer - button', () => { diff --git a/packages/graphiql/cypress/e2e/errors.cy.ts b/packages/graphiql/cypress/e2e/errors.cy.ts index 896b29b046c..0509e320bee 100644 --- a/packages/graphiql/cypress/e2e/errors.cy.ts +++ b/packages/graphiql/cypress/e2e/errors.cy.ts @@ -2,7 +2,7 @@ import { version } from 'graphql'; describe('Errors', () => { it('Should show an error when the HTTP request fails', () => { - cy.visit('?http-error=true'); + cy.visit('/?http-error=true'); cy.assertQueryResult({ errors: [ { @@ -21,14 +21,14 @@ describe('Errors', () => { }); it('Should show an error when introspection fails', () => { - cy.visit('?graphql-error=true'); + cy.visit('/?graphql-error=true'); cy.assertQueryResult({ errors: [{ message: 'Something unexpected happened...' }], }); }); it('Should show an error when the schema is invalid', () => { - cy.visit('?bad=true'); + cy.visit('/?bad=true'); /** * We can't use `cy.assertQueryResult` here because the stack contains line * and column numbers of the `graphiql.min.js` bundle which are not stable. diff --git a/packages/graphiql/cypress/e2e/history.cy.ts b/packages/graphiql/cypress/e2e/history.cy.ts index dfadc746df7..d723427e3ca 100644 --- a/packages/graphiql/cypress/e2e/history.cy.ts +++ b/packages/graphiql/cypress/e2e/history.cy.ts @@ -13,20 +13,20 @@ describe('history', () => { }); it('defaults to closed history panel', () => { - cy.visit(''); + cy.visit('/'); cy.get('.graphiql-history').should('not.exist'); }); it('will save history item even when history panel is closed', () => { - cy.visit('?query={test}'); + cy.visit('/?query={test}'); cy.clickExecuteQuery(); cy.get('button[aria-label="Show History"]').click(); cy.get('ul.graphiql-history-items').should('have.length', 1); }); it('will save history item even when history panel is closed', () => { - cy.visit('?query={test}'); + cy.visit('/?query={test}'); cy.clickExecuteQuery(); cy.get('button[aria-label="Show History"]').click(); cy.get('ul.graphiql-history-items li').should('have.length', 1); @@ -87,102 +87,4 @@ describe('history', () => { cy.get('ul.graphiql-history-items li').should('have.length', 2); }); - // it('will save query if variables are different', async () => { - // const { getByLabelText, container } = render( - // , - // ); - - // act(() => { - // fireEvent.click(getByLabelText('Show History')); - // }); - - // const executeQueryButton = getByLabelText('Execute query (Ctrl-Enter)'); - - // act(() => { - // fireEvent.click(executeQueryButton); - // }); - - // await waitFor(() => { - // expect( - // container.querySelectorAll('.graphiql-history-item'), - // ).toHaveLength(1); - // }); - - // act(() => { - // fireEvent.change( - // container.querySelector('[aria-label="Variables"] .mockCodeMirror'), - // { - // target: { value: mockVariables2 }, - // }, - // ); - // }); - - // act(() => { - // fireEvent.click(executeQueryButton); - // }); - - // await waitFor(() => { - // expect( - // container.querySelectorAll('.graphiql-history-item'), - // ).toHaveLength(2); - // }); - // }); - - // it('will save query if headers are different', async () => { - // const { getByLabelText, getByText, container } = render( - // , - // ); - - // act(() => { - // fireEvent.click(getByLabelText('Show History')); - // }); - - // const executeQueryButton = getByLabelText('Execute query (Ctrl-Enter)'); - - // act(() => { - // fireEvent.click(executeQueryButton); - // }); - - // await waitFor(() => { - // expect( - // container.querySelectorAll('.graphiql-history-item'), - // ).toHaveLength(1); - // }); - - // act(() => { - // fireEvent.click(getByText('Headers')); - // }); - - // act(() => { - // fireEvent.change( - // container.querySelector('[aria-label="Headers"] .mockCodeMirror'), - // { - // target: { value: mockHeaders2 }, - // }, - // ); - // }); - - // act(() => { - // fireEvent.click(executeQueryButton); - // }); - - // await waitFor(() => { - // expect( - // container.querySelectorAll('.graphiql-history-item'), - // ).toHaveLength(2); - // }); - // }); -}); // history +}); diff --git a/packages/graphiql/cypress/e2e/init.cy.ts b/packages/graphiql/cypress/e2e/init.cy.ts index 379d5aeb99f..960faecd627 100644 --- a/packages/graphiql/cypress/e2e/init.cy.ts +++ b/packages/graphiql/cypress/e2e/init.cy.ts @@ -36,7 +36,7 @@ describe('GraphiQL On Initialization', () => { '.graphiql-response', '.graphiql-editor-tool', ]; - cy.visit(''); + cy.visit('/'); cy.get('.graphiql-query-editor').contains('# Welcome to GraphiQL'); for (const cSelector of containers) { cy.get(cSelector).should('be.visible'); @@ -49,7 +49,7 @@ describe('GraphiQL On Initialization', () => { cy.assertQueryResult(mockSuccess); }); it('Shows the expected error when the schema is invalid', () => { - cy.visit('?bad=true'); + cy.visit('/?bad=true'); cy.get('section.result-window').should(element => { expect(element.get(0).innerText).to.contain('Names must'); }); diff --git a/packages/graphiql/cypress/e2e/keyboard.cy.ts b/packages/graphiql/cypress/e2e/keyboard.cy.ts index 82a12df84c6..0883b102eca 100644 --- a/packages/graphiql/cypress/e2e/keyboard.cy.ts +++ b/packages/graphiql/cypress/e2e/keyboard.cy.ts @@ -1,6 +1,6 @@ describe('GraphiQL keyboard interactions', () => { it('Does not prevent the escape key from being handled outside the editor', () => { - cy.visit(''); + cy.visit('/'); const mockFn = cy.stub().as('escapeHandler'); cy.document().then(doc => { doc.addEventListener('keydown', event => { @@ -16,7 +16,7 @@ describe('GraphiQL keyboard interactions', () => { }); it('Does prevent the escape key from being handled outside the editor if closing the autocomplete dialog', () => { - cy.visit(''); + cy.visit('/'); const mockFn = cy.stub().as('escapeHandler'); cy.document().then(doc => { doc.addEventListener('keydown', event => { diff --git a/packages/graphiql/cypress/e2e/tabs.cy.ts b/packages/graphiql/cypress/e2e/tabs.cy.ts index a531938213b..4ad14f76d14 100644 --- a/packages/graphiql/cypress/e2e/tabs.cy.ts +++ b/packages/graphiql/cypress/e2e/tabs.cy.ts @@ -1,6 +1,6 @@ describe('Tabs', () => { it('Should store editor contents when switching between tabs', () => { - cy.visit('?query='); + cy.visit('/?query='); // Assert that no tab visible when there's only one session cy.get('#graphiql-session-tab-0').should('not.exist'); diff --git a/packages/graphql-language-service-cli/package.json b/packages/graphql-language-service-cli/package.json index e3d4e7d3582..7c97c46a11a 100644 --- a/packages/graphql-language-service-cli/package.json +++ b/packages/graphql-language-service-cli/package.json @@ -35,6 +35,7 @@ "graphql": "^15.5.0 || ^16.0.0" }, "dependencies": { + "@types/yargs": "^16.0.5", "@babel/polyfill": "^7.12.1", "graphql-language-service": "^5.1.7-alpha.0", "graphql-language-service-server": "^2.11.2-alpha.0", diff --git a/yarn.lock b/yarn.lock index 7a52576d825..5e6ea2a6c36 100644 --- a/yarn.lock +++ b/yarn.lock @@ -78,11 +78,6 @@ dependencies: "@babel/highlight" "^7.22.5" -"@babel/compat-data@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.13.12.tgz#a8a5ccac19c200f9dd49624cac6e19d7be1236a1" - integrity sha512-3eJJ841uKxeV8dcN/2yGEUy+RfgQspPEgQat85umsE1rotuquQ2AbIub4S6j7c50a2d+4myc+zSlnXeIHrOnhQ== - "@babel/compat-data@^7.17.10": version "7.17.10" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.10.tgz#711dc726a492dfc8be8220028b1b92482362baab" @@ -108,26 +103,26 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.5.tgz#b1f6c86a02d85d2dd3368a2b67c09add8cd0c255" integrity sha512-4Jc/YuIaYqKnDDz892kPIledykKg12Aw1PYX5i/TY28anJtacvM1Rrr8wbieB9GfEJwlzqT0hUEao0CxEebiDA== -"@babel/core@^7.1.0": - version "7.13.14" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.13.14.tgz#8e46ebbaca460a63497c797e574038ab04ae6d06" - integrity sha512-wZso/vyF4ki0l0znlgM4inxbdrUvCb+cVz8grxDq+6C9k6qbqoIJteQOKicaKjCipU3ISV+XedCqpL2RJJVehA== +"@babel/core@^7.1.0", "@babel/core@^7.21.3", "@babel/core@^7.21.4", "@babel/core@^7.7.2", "@babel/core@^7.8.0": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.5.tgz#d67d9747ecf26ee7ecd3ebae1ee22225fe902a89" + integrity sha512-SBuTAjg91A3eKOvD+bPEz3LlhHZRNu1nFOVts9lzDJTXshHTjII0BAtDS3Y2DAkdZdDKWVZGVwkDfc4Clxn1dg== dependencies: - "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.13.9" - "@babel/helper-compilation-targets" "^7.13.13" - "@babel/helper-module-transforms" "^7.13.14" - "@babel/helpers" "^7.13.10" - "@babel/parser" "^7.13.13" - "@babel/template" "^7.12.13" - "@babel/traverse" "^7.13.13" - "@babel/types" "^7.13.14" + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.22.5" + "@babel/generator" "^7.22.5" + "@babel/helper-compilation-targets" "^7.22.5" + "@babel/helper-module-transforms" "^7.22.5" + "@babel/helpers" "^7.22.5" + "@babel/parser" "^7.22.5" + "@babel/template" "^7.22.5" + "@babel/traverse" "^7.22.5" + "@babel/types" "^7.22.5" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" - json5 "^2.1.2" + json5 "^2.2.2" semver "^6.3.0" - source-map "^0.5.0" "@babel/core@^7.11.6", "@babel/core@^7.21.0": version "7.21.0" @@ -192,48 +187,6 @@ json5 "^2.2.1" semver "^6.3.0" -"@babel/core@^7.21.3", "@babel/core@^7.21.4": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.5.tgz#d67d9747ecf26ee7ecd3ebae1ee22225fe902a89" - integrity sha512-SBuTAjg91A3eKOvD+bPEz3LlhHZRNu1nFOVts9lzDJTXshHTjII0BAtDS3Y2DAkdZdDKWVZGVwkDfc4Clxn1dg== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.22.5" - "@babel/generator" "^7.22.5" - "@babel/helper-compilation-targets" "^7.22.5" - "@babel/helper-module-transforms" "^7.22.5" - "@babel/helpers" "^7.22.5" - "@babel/parser" "^7.22.5" - "@babel/template" "^7.22.5" - "@babel/traverse" "^7.22.5" - "@babel/types" "^7.22.5" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.2" - semver "^6.3.0" - -"@babel/core@^7.7.2", "@babel/core@^7.8.0": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.18.9.tgz#805461f967c77ff46c74ca0460ccf4fe933ddd59" - integrity sha512-1LIb1eL8APMy91/IMW+31ckrfBM4yCoLaVzoDhZUKSM4cu1L1nIidyxkCgzPAgrC5WEz36IPEr/eSeSF9pIn+g== - dependencies: - "@ampproject/remapping" "^2.1.0" - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.18.9" - "@babel/helper-compilation-targets" "^7.18.9" - "@babel/helper-module-transforms" "^7.18.9" - "@babel/helpers" "^7.18.9" - "@babel/parser" "^7.18.9" - "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.9" - "@babel/types" "^7.18.9" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.1" - semver "^6.3.0" - "@babel/eslint-parser@^7.21.3": version "7.21.3" resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.21.3.tgz#d79e822050f2de65d7f368a076846e7184234af7" @@ -243,15 +196,6 @@ eslint-visitor-keys "^2.1.0" semver "^6.3.0" -"@babel/generator@^7.13.9": - version "7.13.9" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.13.9.tgz#3a7aa96f9efb8e2be42d38d80e2ceb4c64d8de39" - integrity sha512-mHOOmY0Axl/JCTkxTU6Lf5sWOg/v8nUa+Xkt4zMTftX0wqmb6Sh7J8gvcehBw7q0AhrhAR+FDacKjCZ2X8K+Sw== - dependencies: - "@babel/types" "^7.13.0" - jsesc "^2.5.1" - source-map "^0.5.0" - "@babel/generator@^7.17.10": version "7.17.10" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.10.tgz#c281fa35b0c349bbe9d02916f4ae08fc85ed7189" @@ -328,16 +272,6 @@ "@babel/helper-explode-assignable-expression" "^7.18.6" "@babel/types" "^7.18.9" -"@babel/helper-compilation-targets@^7.13.13": - version "7.13.13" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.13.tgz#2b2972a0926474853f41e4adbc69338f520600e5" - integrity sha512-q1kcdHNZehBwD9jYPh3WyXcsFERi39X4I59I3NadciWtNDyZ6x+GboOxncFK0kXlKIv6BJm5acncehXWUjWQMQ== - dependencies: - "@babel/compat-data" "^7.13.12" - "@babel/helper-validator-option" "^7.12.17" - browserslist "^4.14.5" - semver "^6.3.0" - "@babel/helper-compilation-targets@^7.17.10": version "7.17.10" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.10.tgz#09c63106d47af93cf31803db6bc49fef354e2ebe" @@ -456,15 +390,6 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-function-name@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz#93ad656db3c3c2232559fd7b2c3dbdcbe0eb377a" - integrity sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA== - dependencies: - "@babel/helper-get-function-arity" "^7.12.13" - "@babel/template" "^7.12.13" - "@babel/types" "^7.12.13" - "@babel/helper-function-name@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz#f1ec51551fb1c8956bc8dd95f38523b6cf375f8f" @@ -506,13 +431,6 @@ "@babel/template" "^7.22.5" "@babel/types" "^7.22.5" -"@babel/helper-get-function-arity@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz#bc63451d403a3b3082b97e1d8b3fe5bd4091e583" - integrity sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg== - dependencies: - "@babel/types" "^7.12.13" - "@babel/helper-get-function-arity@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz#ea08ac753117a669f1508ba06ebcc49156387419" @@ -541,13 +459,6 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-member-expression-to-functions@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz#dfe368f26d426a07299d8d6513821768216e6d72" - integrity sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw== - dependencies: - "@babel/types" "^7.13.12" - "@babel/helper-member-expression-to-functions@^7.20.7", "@babel/helper-member-expression-to-functions@^7.21.0": version "7.21.0" resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.21.0.tgz#319c6a940431a133897148515877d2f3269c3ba5" @@ -555,13 +466,6 @@ dependencies: "@babel/types" "^7.21.0" -"@babel/helper-module-imports@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz#c6a369a6f3621cb25da014078684da9196b61977" - integrity sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA== - dependencies: - "@babel/types" "^7.13.12" - "@babel/helper-module-imports@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz#25612a8091a999704461c8a222d0efec5d091437" @@ -583,20 +487,6 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-module-transforms@^7.13.14": - version "7.13.14" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.13.14.tgz#e600652ba48ccb1641775413cb32cfa4e8b495ef" - integrity sha512-QuU/OJ0iAOSIatyVZmfqB0lbkVP0kDRiKj34xy+QNsnVZi/PA6BoSoreeqnxxa9EHFAIL0R9XOaAR/G9WlIy5g== - dependencies: - "@babel/helper-module-imports" "^7.13.12" - "@babel/helper-replace-supers" "^7.13.12" - "@babel/helper-simple-access" "^7.13.12" - "@babel/helper-split-export-declaration" "^7.12.13" - "@babel/helper-validator-identifier" "^7.12.11" - "@babel/template" "^7.12.13" - "@babel/traverse" "^7.13.13" - "@babel/types" "^7.13.14" - "@babel/helper-module-transforms@^7.17.7": version "7.17.7" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz#3943c7f777139e7954a5355c815263741a9c1cbd" @@ -625,20 +515,6 @@ "@babel/traverse" "^7.21.2" "@babel/types" "^7.21.2" -"@babel/helper-module-transforms@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.18.9.tgz#5a1079c005135ed627442df31a42887e80fcb712" - integrity sha512-KYNqY0ICwfv19b31XzvmI/mfcylOzbLtowkw+mfvGPAQ3kfCnMLYbED3YecL5tPd8nAYFQFAd6JHp2LxZk/J1g== - dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-simple-access" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/helper-validator-identifier" "^7.18.6" - "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.9" - "@babel/types" "^7.18.9" - "@babel/helper-module-transforms@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz#0f65daa0716961b6e96b164034e737f60a80d2ef" @@ -653,13 +529,6 @@ "@babel/traverse" "^7.22.5" "@babel/types" "^7.22.5" -"@babel/helper-optimise-call-expression@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz#5c02d171b4c8615b1e7163f888c1c81c30a2aaea" - integrity sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA== - dependencies: - "@babel/types" "^7.12.13" - "@babel/helper-optimise-call-expression@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz#9369aa943ee7da47edab2cb4e838acf09d290ffe" @@ -707,16 +576,6 @@ "@babel/helper-wrap-function" "^7.18.9" "@babel/types" "^7.18.9" -"@babel/helper-replace-supers@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz#6442f4c1ad912502481a564a7386de0c77ff3804" - integrity sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.13.12" - "@babel/helper-optimise-call-expression" "^7.12.13" - "@babel/traverse" "^7.13.0" - "@babel/types" "^7.13.12" - "@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.20.7": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.20.7.tgz#243ecd2724d2071532b2c8ad2f0f9f083bcae331" @@ -729,13 +588,6 @@ "@babel/traverse" "^7.20.7" "@babel/types" "^7.20.7" -"@babel/helper-simple-access@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz#dd6c538afb61819d205a012c31792a39c7a5eaf6" - integrity sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA== - dependencies: - "@babel/types" "^7.13.12" - "@babel/helper-simple-access@^7.17.7": version "7.17.7" resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz#aaa473de92b7987c6dfa7ce9a7d9674724823367" @@ -743,13 +595,6 @@ dependencies: "@babel/types" "^7.17.0" -"@babel/helper-simple-access@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz#d6d8f51f4ac2978068df934b569f08f29788c7ea" - integrity sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g== - dependencies: - "@babel/types" "^7.18.6" - "@babel/helper-simple-access@^7.20.2": version "7.20.2" resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz#0ab452687fe0c2cfb1e2b9e0015de07fc2d62dd9" @@ -771,13 +616,6 @@ dependencies: "@babel/types" "^7.20.0" -"@babel/helper-split-export-declaration@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05" - integrity sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg== - dependencies: - "@babel/types" "^7.12.13" - "@babel/helper-split-export-declaration@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz#0b648c0c42da9d3920d85ad585f2778620b8726b" @@ -834,11 +672,6 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193" integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ== -"@babel/helper-validator-option@^7.12.17": - version "7.12.17" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz#d1fbf012e1a79b7eebbfdc6d270baaf8d9eb9831" - integrity sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw== - "@babel/helper-validator-option@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" @@ -869,15 +702,6 @@ "@babel/traverse" "^7.20.5" "@babel/types" "^7.20.5" -"@babel/helpers@^7.13.10": - version "7.13.10" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.13.10.tgz#fd8e2ba7488533cdeac45cc158e9ebca5e3c7df8" - integrity sha512-4VO883+MWPDUVRF3PhiLBUFHoX/bsLTGFpFK/HqvvfBZz2D57u9XzPVNFVBTc0PW/CWR9BXTOKt8NF4DInUHcQ== - dependencies: - "@babel/template" "^7.12.13" - "@babel/traverse" "^7.13.0" - "@babel/types" "^7.13.0" - "@babel/helpers@^7.17.8": version "7.17.8" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.8.tgz#288450be8c6ac7e4e44df37bcc53d345e07bc106" @@ -896,15 +720,6 @@ "@babel/traverse" "^7.17.9" "@babel/types" "^7.17.0" -"@babel/helpers@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.18.9.tgz#4bef3b893f253a1eced04516824ede94dcfe7ff9" - integrity sha512-Jf5a+rbrLoR4eNdUmnFu8cN5eNJT6qdTdOg5IHIzq87WwyRw9PwguLFOWYgktN/60IP4fgDUawJvs7PjQIzELQ== - dependencies: - "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.9" - "@babel/types" "^7.18.9" - "@babel/helpers@^7.21.0": version "7.21.0" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.21.0.tgz#9dd184fb5599862037917cdc9eecb84577dc4e7e" @@ -959,7 +774,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.13": +"@babel/parser@^7.1.0", "@babel/parser@^7.12.13": version "7.13.13" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.13.tgz#42f03862f4aed50461e543270916b47dd501f0df" integrity sha512-OhsyMrqygfk5v8HmWwOzlYjJrtLaFhF34MrfG/Z73DgYCI6ojNUTUp2TYbtnjo8PegeJp12eamsNettCQjKjVw== @@ -1799,15 +1614,6 @@ dependencies: regenerator-runtime "^0.13.11" -"@babel/template@^7.12.13", "@babel/template@^7.3.3": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" - integrity sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== - dependencies: - "@babel/code-frame" "^7.12.13" - "@babel/parser" "^7.12.13" - "@babel/types" "^7.12.13" - "@babel/template@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" @@ -1844,19 +1650,14 @@ "@babel/parser" "^7.22.5" "@babel/types" "^7.22.5" -"@babel/traverse@^7.13.0", "@babel/traverse@^7.13.13": - version "7.13.13" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.13.13.tgz#39aa9c21aab69f74d948a486dd28a2dbdbf5114d" - integrity sha512-CblEcwmXKR6eP43oQGG++0QMTtCjAsa3frUuzHoiIJWpaIIi8dwMyEFUJoXRLxagGqCK+jALRwIO+o3R9p/uUg== +"@babel/template@^7.3.3": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" + integrity sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== dependencies: "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.13.9" - "@babel/helper-function-name" "^7.12.13" - "@babel/helper-split-export-declaration" "^7.12.13" - "@babel/parser" "^7.13.13" - "@babel/types" "^7.13.13" - debug "^4.1.0" - globals "^11.1.0" + "@babel/parser" "^7.12.13" + "@babel/types" "^7.12.13" "@babel/traverse@^7.17.10", "@babel/traverse@^7.17.9": version "7.17.10" @@ -1890,22 +1691,6 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/traverse@^7.18.9", "@babel/traverse@^7.7.2": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.9.tgz#deeff3e8f1bad9786874cb2feda7a2d77a904f98" - integrity sha512-LcPAnujXGwBgv3/WHv01pHtb2tihcyW1XuL9wd7jqh1Z8AQkTd+QVjMrMijrln0T7ED3UXLIy36P9Ao7W75rYg== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.18.9" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.18.9" - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.18.9" - "@babel/types" "^7.18.9" - debug "^4.1.0" - globals "^11.1.0" - "@babel/traverse@^7.20.5", "@babel/traverse@^7.20.7", "@babel/traverse@^7.21.0", "@babel/traverse@^7.21.2": version "7.21.2" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.2.tgz#ac7e1f27658750892e815e60ae90f382a46d8e75" @@ -1938,7 +1723,23 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.13.12", "@babel/types@^7.13.13", "@babel/types@^7.13.14", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": +"@babel/traverse@^7.7.2": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.9.tgz#deeff3e8f1bad9786874cb2feda7a2d77a904f98" + integrity sha512-LcPAnujXGwBgv3/WHv01pHtb2tihcyW1XuL9wd7jqh1Z8AQkTd+QVjMrMijrln0T7ED3UXLIy36P9Ao7W75rYg== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.18.9" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.18.9" + "@babel/helper-hoist-variables" "^7.18.6" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/parser" "^7.18.9" + "@babel/types" "^7.18.9" + debug "^4.1.0" + globals "^11.1.0" + +"@babel/types@^7.0.0", "@babel/types@^7.12.13", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.13.14" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.14.tgz#c35a4abb15c7cd45a2746d78ab328e362cbace0d" integrity sha512-A2aa3QTkWoyqsZZFl56MLUsfmh7O0gN41IPvXAE/++8ojpbz12SszD7JEGYVdn4f9Kt4amIei07swF1h4AqmmQ== @@ -3250,6 +3051,13 @@ "@types/node" "*" jest-mock "^27.5.1" +"@jest/expect-utils@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.5.0.tgz#f74fad6b6e20f924582dc8ecbf2cb800fe43a036" + integrity sha512-fmKzsidoXQT2KwnrwE0SQq3uj8Z763vzR8LnLBwC2qYWEFpjX8daRsk6rHUM1QvNlEW/UJXNXm59ztmJJWs2Mg== + dependencies: + jest-get-type "^29.4.3" + "@jest/fake-timers@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.5.1.tgz#76979745ce0579c8a94a4678af7a748eda8ada74" @@ -3423,6 +3231,18 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" +"@jest/types@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.5.0.tgz#f59ef9b031ced83047c67032700d8c807d6e1593" + integrity sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog== + dependencies: + "@jest/schemas" "^29.4.3" + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^17.0.8" + chalk "^4.0.0" + "@jridgewell/gen-mapping@^0.1.0": version "0.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" @@ -4168,9 +3988,9 @@ integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== "@sinonjs/commons@^1.7.0": - version "1.8.3" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" - integrity sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ== + version "1.8.6" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9" + integrity sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ== dependencies: type-detect "4.0.8" @@ -4351,7 +4171,18 @@ "@types/express" "*" "@types/node" "*" -"@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": +"@types/babel__core@^7.0.0": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.1.tgz#916ecea274b0c776fec721e333e55762d3a9614b" + integrity sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw== + dependencies: + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__core@^7.1.14": version "7.1.16" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.16.tgz#bc12c74b7d65e82d29876b5d0baf5c625ac58702" integrity sha512-EAEHtisTMM+KaKwfWdC3oyllIqswlznXCIVCt7/oRNrh+DhgT4UEBNC/jlADNjvw7UnfbcdkGQcPVZ1xYiLcrQ== @@ -4385,11 +4216,11 @@ "@babel/types" "^7.3.0" "@types/babel__traverse@^7.0.4": - version "7.17.1" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.17.1.tgz#1a0e73e8c28c7e832656db372b779bfd2ef37314" - integrity sha512-kVzjari1s2YVi77D3w1yuvohV2idweYXMCDzqBiVNN63TcDWrIlTVOYpqVrvbbyOE/IyzBoTKF0fdnLPEORFxA== + version "7.20.1" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.1.tgz#dd6f1d2411ae677dcb2db008c962598be31d6acf" + integrity sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg== dependencies: - "@babel/types" "^7.3.0" + "@babel/types" "^7.20.7" "@types/benchmark@^1.0.33": version "1.0.33" @@ -4550,14 +4381,7 @@ "@types/minimatch" "^5.1.2" "@types/node" "*" -"@types/graceful-fs@^4.1.2": - version "4.1.5" - resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" - integrity sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw== - dependencies: - "@types/node" "*" - -"@types/graceful-fs@^4.1.3": +"@types/graceful-fs@^4.1.2", "@types/graceful-fs@^4.1.3": version "4.1.6" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.6.tgz#e14b2576a1c25026b7f02ede1de3b84c3a1efeae" integrity sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw== @@ -4622,7 +4446,7 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@*", "@types/jest@^26.0.22": +"@types/jest@*": version "26.0.22" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.22.tgz#8308a1debdf1b807aa47be2838acdcd91e88fbe6" integrity sha512-eeWwWjlqxvBxc4oQdkueW5OF/gtfSceKk4OnOAGlUSwS/liBRtZppbJuz1YkgbrbfGOoeBHun9fOvXnjNwrSOw== @@ -4630,6 +4454,14 @@ jest-diff "^26.0.0" pretty-format "^26.0.0" +"@types/jest@^29.5.2": + version "29.5.2" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.2.tgz#86b4afc86e3a8f3005b297ed8a72494f89e6395b" + integrity sha512-mSoZVJF5YzGVCk+FsDxzDuH7s+SCkzrgKZzf0Z0T2WudhBUPoF6ktoTPC4R0ZoCPCV5xUvuU6ias5NvxcBcMMg== + dependencies: + expect "^29.0.0" + pretty-format "^29.0.0" + "@types/json-schema@*", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.11" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" @@ -4981,6 +4813,13 @@ dependencies: "@types/yargs-parser" "*" +"@types/yargs@^16.0.5": + version "16.0.5" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.5.tgz#12cc86393985735a283e387936398c2f9e5f88e3" + integrity sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ== + dependencies: + "@types/yargs-parser" "*" + "@types/yargs@^17.0.8": version "17.0.22" resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.22.tgz#7dd37697691b5f17d020f3c63e7a45971ff71e9a" @@ -5490,9 +5329,9 @@ integrity sha512-uUrgZ8AxS+Lio0fZKAipJjAh415JyrOZowliZAzmnJSsf7piVL5w+G0+gFJ0KSu3QRhvui/7zuvpLz03YjXAhg== abab@^2.0.3, abab@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a" - integrity sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q== + version "2.0.6" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" + integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== abort-controller@^3.0.0: version "3.0.0" @@ -5542,11 +5381,16 @@ acorn@^7.1.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.0.0, acorn@^8.0.4, acorn@^8.1.0, acorn@^8.2.4, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0: +acorn@^8.0.0, acorn@^8.0.4, acorn@^8.1.0, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0: version "8.8.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== +acorn@^8.2.4: + version "8.9.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.9.0.tgz#78a16e3b2bcc198c10822786fa6679e245db5b59" + integrity sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ== + agent-base@6: version "6.0.2" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" @@ -7139,13 +6983,18 @@ content-type@^1.0.4, content-type@~1.0.4: resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== -convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.7.0: +convert-source-map@^1.1.0, convert-source-map@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== dependencies: safe-buffer "~5.1.1" +convert-source-map@^1.4.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" + integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== + convert-source-map@^1.6.0: version "1.8.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" @@ -7739,9 +7588,9 @@ decamelize@^4.0.0: integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== decimal.js@^10.2.1: - version "10.2.1" - resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.2.1.tgz#238ae7b0f0c793d3e3cea410108b35a2c01426a3" - integrity sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw== + version "10.4.3" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" + integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== decode-named-character-reference@^1.0.0: version "1.0.2" @@ -7795,16 +7644,11 @@ deep-extend@^0.6.0: resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== -deep-is@^0.1.3: +deep-is@^0.1.3, deep-is@~0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= - deepmerge@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" @@ -7931,6 +7775,11 @@ diff-sequences@^27.5.1: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327" integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ== +diff-sequences@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.4.3.tgz#9314bc1fabe09267ffeca9cbafc457d8499a13f2" + integrity sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA== + diff@5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" @@ -9322,6 +9171,17 @@ expect@^27.5.1: jest-matcher-utils "^27.5.1" jest-message-util "^27.5.1" +expect@^29.0.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.5.0.tgz#68c0509156cb2a0adb8865d413b137eeaae682f7" + integrity sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg== + dependencies: + "@jest/expect-utils" "^29.5.0" + jest-get-type "^29.4.3" + jest-matcher-utils "^29.5.0" + jest-message-util "^29.5.0" + jest-util "^29.5.0" + express-graphql@experimental-stream-defer: version "0.12.0-experimental-stream-defer.1" resolved "https://registry.yarnpkg.com/express-graphql/-/express-graphql-0.12.0-experimental-stream-defer.1.tgz#1723f400cd94065e9a584ad4677a0d2ce4a7e7d1" @@ -11735,6 +11595,16 @@ jest-diff@^27.5.1: jest-get-type "^27.5.1" pretty-format "^27.5.1" +jest-diff@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.5.0.tgz#e0d83a58eb5451dcc1fa61b1c3ee4e8f5a290d63" + integrity sha512-LtxijLLZBduXnHSniy0WMdaHjmQnt3g5sa16W4p0HqukYTTsyTW3GD1q41TyGl5YFXj/5B2U6dlh5FM1LIMgxw== + dependencies: + chalk "^4.0.0" + diff-sequences "^29.4.3" + jest-get-type "^29.4.3" + pretty-format "^29.5.0" + jest-docblock@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.5.1.tgz#14092f364a42c6108d42c33c8cf30e058e25f6c0" @@ -11788,6 +11658,11 @@ jest-get-type@^27.5.1: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.5.1.tgz#3cd613c507b0f7ace013df407a1c1cd578bcb4f1" integrity sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw== +jest-get-type@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.4.3.tgz#1ab7a5207c995161100b5187159ca82dd48b3dd5" + integrity sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg== + jest-haste-map@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.5.1.tgz#9fd8bd7e7b4fa502d9c6164c5640512b4e811e7f" @@ -11868,6 +11743,16 @@ jest-matcher-utils@^27.5.1: jest-get-type "^27.5.1" pretty-format "^27.5.1" +jest-matcher-utils@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.5.0.tgz#d957af7f8c0692c5453666705621ad4abc2c59c5" + integrity sha512-lecRtgm/rjIK0CQ7LPQwzCs2VwW6WAahA55YBuI+xqmhm7LAaxokSB8C97yJeYyT+HvQkH741StzpU41wohhWw== + dependencies: + chalk "^4.0.0" + jest-diff "^29.5.0" + jest-get-type "^29.4.3" + pretty-format "^29.5.0" + jest-message-util@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.5.1.tgz#bdda72806da10d9ed6425e12afff38cd1458b6cf" @@ -11883,6 +11768,21 @@ jest-message-util@^27.5.1: slash "^3.0.0" stack-utils "^2.0.3" +jest-message-util@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.5.0.tgz#1f776cac3aca332ab8dd2e3b41625435085c900e" + integrity sha512-Kijeg9Dag6CKtIDA7O21zNTACqD5MD/8HfIV8pdD94vFyFuer52SigdC3IQMhab3vACxXMiFk+yMHNdbqtyTGA== + dependencies: + "@babel/code-frame" "^7.12.13" + "@jest/types" "^29.5.0" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.9" + micromatch "^4.0.4" + pretty-format "^29.5.0" + slash "^3.0.0" + stack-utils "^2.0.3" + jest-mock@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.5.1.tgz#19948336d49ef4d9c52021d34ac7b5f36ff967d6" @@ -12046,6 +11946,18 @@ jest-util@^29.4.3: graceful-fs "^4.2.9" picomatch "^2.2.3" +jest-util@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.5.0.tgz#24a4d3d92fc39ce90425311b23c27a6e0ef16b8f" + integrity sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ== + dependencies: + "@jest/types" "^29.5.0" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + jest-validate@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.5.1.tgz#9197d54dc0bdb52260b8db40b46ae668e04df067" @@ -12393,7 +12305,7 @@ levn@^0.4.1: levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + integrity sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== dependencies: prelude-ls "~1.1.2" type-check "~0.3.2" @@ -13813,9 +13725,9 @@ number-is-nan@^1.0.0: integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= nwsapi@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" - integrity sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ== + version "2.2.5" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.5.tgz#a52744c61b3889dd44b0a158687add39b8d935e2" + integrity sha512-6xpotnECFy/og7tKSBVmUNft7J3jyXAka4XvG6AUhFWRz+Q/Ljus7znJAA3bxColfQLdS+XsjoodtJfCgeTEFQ== object-assign@^4, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" @@ -15048,7 +14960,7 @@ prelude-ls@^1.2.1: prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== prepend-http@^2.0.0: version "2.0.0" @@ -15102,6 +15014,15 @@ pretty-format@^27.0.2, pretty-format@^27.5.1: ansi-styles "^5.0.0" react-is "^17.0.1" +pretty-format@^29.0.0, pretty-format@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.5.0.tgz#283134e74f70e2e3e7229336de0e4fce94ccde5a" + integrity sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw== + dependencies: + "@jest/schemas" "^29.4.3" + ansi-styles "^5.0.0" + react-is "^18.0.0" + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -15168,11 +15089,16 @@ pseudomap@^1.0.2: resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= -psl@^1.1.28, psl@^1.1.33: +psl@^1.1.28: version "1.8.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== +psl@^1.1.33: + version "1.9.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" + integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== + pump@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" @@ -15222,6 +15148,11 @@ qs@~6.10.3: dependencies: side-channel "^1.0.4" +querystringify@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" + integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== + queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" @@ -15320,7 +15251,7 @@ react-hot-loader@^4.12.20: shallowequal "^1.1.0" source-map "^0.7.3" -"react-is@^16.12.0 || ^17.0.0 || ^18.0.0", react-is@^18.2.0: +"react-is@^16.12.0 || ^17.0.0 || ^18.0.0", react-is@^18.0.0, react-is@^18.2.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== @@ -15796,9 +15727,9 @@ resolve-global@^1.0.0: global-dirs "^0.1.1" resolve.exports@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" - integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== + version "1.1.1" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.1.tgz#05cfd5b3edf641571fd46fa608b610dda9ead999" + integrity sha512-/NtpHNDN7jWhAaQ9BvBUYZ6YTXsRBgfqWFWP7BZBaoMJO/I3G5OFzvTuWNlZC3aPjins1F+TNrLKsGbH4rfsRQ== resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.15.1, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.0: version "1.22.1" @@ -16946,9 +16877,9 @@ supports-color@^7.0.0, supports-color@^7.1.0: has-flag "^4.0.0" supports-hyperlinks@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz#4f77b42488765891774b70c79babd87f9bd594bb" - integrity sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ== + version "2.3.0" + resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz#3943544347c1ff90b15effb03fc14ae45ec10624" + integrity sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA== dependencies: has-flag "^4.0.0" supports-color "^7.0.0" @@ -17081,9 +17012,9 @@ throat@^4.0.0, throat@^4.1.0: integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo= throat@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/throat/-/throat-6.0.1.tgz#d514fedad95740c12c2d7fc70ea863eb51ade375" - integrity sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w== + version "6.0.2" + resolved "https://registry.yarnpkg.com/throat/-/throat-6.0.2.tgz#51a3fbb5e11ae72e2cf74861ed5c8020f89f29fe" + integrity sha512-WKexMoJj3vEuK0yFEapj8y64V0A6xcuPuK9Gt1d0R+dzCSJc0lHqQytAbSB4cDAK0dWh4T0E2ETkoLE2WZ41OQ== throttleit@^1.0.0: version "1.0.0" @@ -17194,13 +17125,14 @@ toidentifier@1.0.1: integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== tough-cookie@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.0.0.tgz#d822234eeca882f991f0f908824ad2622ddbece4" - integrity sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg== + version "4.1.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.3.tgz#97b9adb0728b42280aa3d814b6b999b2ff0318bf" + integrity sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw== dependencies: psl "^1.1.33" punycode "^2.1.1" - universalify "^0.1.2" + universalify "^0.2.0" + url-parse "^1.5.3" tough-cookie@~2.5.0: version "2.5.0" @@ -17210,10 +17142,10 @@ tough-cookie@~2.5.0: psl "^1.1.28" punycode "^2.1.1" -tr46@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.0.2.tgz#03273586def1595ae08fedb38d7733cee91d2479" - integrity sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg== +tr46@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" + integrity sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw== dependencies: punycode "^2.1.1" @@ -17378,7 +17310,7 @@ type-check@^0.4.0, type-check@~0.4.0: type-check@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= + integrity sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== dependencies: prelude-ls "~1.1.2" @@ -17657,11 +17589,16 @@ universal-user-agent@^6.0.0: resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee" integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w== -universalify@^0.1.0, universalify@^0.1.2: +universalify@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== +universalify@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" + integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== + universalify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-1.0.0.tgz#b61a1da173e8435b2fe3c67d29b9adf8594bd16d" @@ -17724,6 +17661,14 @@ url-parse-lax@^3.0.0: dependencies: prepend-http "^2.0.0" +url-parse@^1.5.3: + version "1.5.10" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" + integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== + dependencies: + querystringify "^2.1.1" + requires-port "^1.0.0" + use-callback-ref@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/use-callback-ref/-/use-callback-ref-1.3.0.tgz#772199899b9c9a50526fedc4993fc7fa1f7e32d5" @@ -18023,20 +17968,20 @@ wait-on@5.3.0: minimist "^1.2.5" rxjs "^6.6.3" -walker@^1.0.7, walker@~1.0.5: - version "1.0.7" - resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" - integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= - dependencies: - makeerror "1.0.x" - -walker@^1.0.8: +walker@^1.0.7, walker@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== dependencies: makeerror "1.0.12" +walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= + dependencies: + makeerror "1.0.x" + watch@~0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc" @@ -18267,12 +18212,12 @@ whatwg-url@^5.0.0: webidl-conversions "^3.0.0" whatwg-url@^8.0.0, whatwg-url@^8.5.0: - version "8.5.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.5.0.tgz#7752b8464fc0903fec89aa9846fc9efe07351fd3" - integrity sha512-fy+R77xWv0AiqfLl4nuGUlQ3/6b5uNfQ4WAbGQVMYshCTCCPK9psC1nWh3XHuxGVCtlcDDQPQW1csmmIQo+fwg== + version "8.7.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" + integrity sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg== dependencies: lodash "^4.7.0" - tr46 "^2.0.2" + tr46 "^2.1.0" webidl-conversions "^6.1.0" which-boxed-primitive@^1.0.2: @@ -18442,7 +18387,7 @@ ws@8.8.1, ws@>=8.7.0: resolved "https://registry.yarnpkg.com/ws/-/ws-8.8.1.tgz#5dbad0feb7ade8ecc99b830c1d77c913d4955ff0" integrity sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA== -"ws@^5.2.0 || ^6.0.0 || ^7.0.0", ws@^7.4.6: +"ws@^5.2.0 || ^6.0.0 || ^7.0.0": version "7.5.5" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.5.tgz#8b4bc4af518cfabd0473ae4f99144287b33eb881" integrity sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w== @@ -18454,6 +18399,11 @@ ws@^6.0.0: dependencies: async-limiter "~1.0.0" +ws@^7.4.6: + version "7.5.9" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" + integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== + ws@^8.3.0: version "8.3.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.3.0.tgz#7185e252c8973a60d57170175ff55fdbd116070d" From d343841e17ab8ef299ab5bfcd0ccd940d0ce6fc3 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Wed, 21 Jun 2023 15:32:33 +0200 Subject: [PATCH 9/9] formatting --- jest.config.base.js | 2 +- packages/cm6-graphql/jest.config.js | 6 ++---- packages/graphiql-react/__mocks__/svg.jsx | 2 +- .../src/explorer/components/search.tsx | 11 +++++++++-- packages/graphiql/__mocks__/codemirror.ts | 8 ++++---- packages/graphiql/__mocks__/svg.jsx | 2 +- packages/graphiql/cypress.config.ts | 2 +- packages/graphiql/cypress/e2e/history.cy.ts | 13 +++++++------ .../src/components/__tests__/GraphiQL.spec.tsx | 1 - packages/graphiql/test/e2e-server.js | 2 +- 10 files changed, 27 insertions(+), 22 deletions(-) diff --git a/jest.config.base.js b/jest.config.base.js index 6aa4d799c85..8765a91bad9 100644 --- a/jest.config.base.js +++ b/jest.config.base.js @@ -29,7 +29,7 @@ module.exports = (dir, env = 'jsdom') => { // relies on compilation '^cm6-graphql\\/src\\/([^]+)': `${__dirname}/packages/cm6-graphql/dist/$1`, '^example-([^/]+)': `${__dirname}/examples/$1/src`, - '^-!svg-react-loader.*$': '/resources/jest/svgImportMock.js' + '^-!svg-react-loader.*$': '/resources/jest/svgImportMock.js', }, testMatch: ['**/*[-.](spec|test).[jt]s?(x)', '!**/cypress/**'], testEnvironment: env, diff --git a/packages/cm6-graphql/jest.config.js b/packages/cm6-graphql/jest.config.js index 2739d279edf..2e9d6c82a6f 100644 --- a/packages/cm6-graphql/jest.config.js +++ b/packages/cm6-graphql/jest.config.js @@ -1,11 +1,9 @@ const base = require('../../jest.config.base')(__dirname); // remove the ignore line for cm6-graphql -base.testPathIgnorePatterns.pop() +base.testPathIgnorePatterns.pop(); module.exports = { ...base, - transformIgnorePatterns: [ - '/node_modules/(?!@lezer)', - ], + transformIgnorePatterns: ['/node_modules/(?!@lezer)'], }; diff --git a/packages/graphiql-react/__mocks__/svg.jsx b/packages/graphiql-react/__mocks__/svg.jsx index 01a51c00970..47d2425836d 100644 --- a/packages/graphiql-react/__mocks__/svg.jsx +++ b/packages/graphiql-react/__mocks__/svg.jsx @@ -4,4 +4,4 @@ export default function MockedIcon(props) { mocked icon ); -}; +} diff --git a/packages/graphiql-react/src/explorer/components/search.tsx b/packages/graphiql-react/src/explorer/components/search.tsx index 474d89d3bf0..7affdeca08a 100644 --- a/packages/graphiql-react/src/explorer/components/search.tsx +++ b/packages/graphiql-react/src/explorer/components/search.tsx @@ -7,7 +7,14 @@ import { isInterfaceType, isObjectType, } from 'graphql'; -import { FocusEventHandler, useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { + FocusEventHandler, + useCallback, + useEffect, + useMemo, + useRef, + useState, +} from 'react'; import { Combobox } from '@headlessui/react'; import { MagnifyingGlassIcon } from '../../icons'; import { useSchemaContext } from '../../schema'; @@ -63,7 +70,7 @@ export function Search() { [push], ); const [isFocused, setIsFocused] = useState(false); - const handleFocus: FocusEventHandler = useCallback((e) => { + const handleFocus: FocusEventHandler = useCallback(e => { setIsFocused(e.type === 'focus'); }, []); diff --git a/packages/graphiql/__mocks__/codemirror.ts b/packages/graphiql/__mocks__/codemirror.ts index 592d4991330..24efe344a7c 100644 --- a/packages/graphiql/__mocks__/codemirror.ts +++ b/packages/graphiql/__mocks__/codemirror.ts @@ -22,13 +22,13 @@ function CodeMirror(node: HTMLElement, { value, ...options }) { options: { ...options, lint: { - linterOptions: {} - } + linterOptions: {}, + }, }, state: { lint: { - linterOptions: {} - } + linterOptions: {}, + }, }, on(event, handler) { diff --git a/packages/graphiql/__mocks__/svg.jsx b/packages/graphiql/__mocks__/svg.jsx index 01a51c00970..47d2425836d 100644 --- a/packages/graphiql/__mocks__/svg.jsx +++ b/packages/graphiql/__mocks__/svg.jsx @@ -4,4 +4,4 @@ export default function MockedIcon(props) { mocked icon ); -}; +} diff --git a/packages/graphiql/cypress.config.ts b/packages/graphiql/cypress.config.ts index 959caab2621..a2b7771ac3a 100644 --- a/packages/graphiql/cypress.config.ts +++ b/packages/graphiql/cypress.config.ts @@ -6,5 +6,5 @@ export default defineConfig({ }, video: false, viewportWidth: 1920, - viewportHeight: 1080 + viewportHeight: 1080, }); diff --git a/packages/graphiql/cypress/e2e/history.cy.ts b/packages/graphiql/cypress/e2e/history.cy.ts index d723427e3ca..225fbde7e06 100644 --- a/packages/graphiql/cypress/e2e/history.cy.ts +++ b/packages/graphiql/cypress/e2e/history.cy.ts @@ -9,9 +9,7 @@ import { } from '../fixtures/fixtures'; describe('history', () => { - beforeEach(() => { - - }); + beforeEach(() => {}); it('defaults to closed history panel', () => { cy.visit('/'); @@ -64,12 +62,16 @@ describe('history', () => { }); it('will save query if the variables change', () => { - cy.visit(`?query=${mockQuery1}&headers=${mockHeaders1}&variables=${mockVariables1}`); + cy.visit( + `?query=${mockQuery1}&headers=${mockHeaders1}&variables=${mockVariables1}`, + ); cy.get('button[aria-label="Show History"]').click(); cy.clickExecuteQuery(); cy.get('ul.graphiql-history-items li').should('have.length', 1); - cy.visit(`?query=${mockQuery1}&headers=${mockHeaders1}&variables=${mockVariables2}`); + cy.visit( + `?query=${mockQuery1}&headers=${mockHeaders1}&variables=${mockVariables2}`, + ); cy.clickExecuteQuery(); cy.get('button[aria-label="Show History"]').click(); cy.get('ul.graphiql-history-items li').should('have.length', 2); @@ -86,5 +88,4 @@ describe('history', () => { cy.get('button[aria-label="Show History"]').click(); cy.get('ul.graphiql-history-items li').should('have.length', 2); }); - }); diff --git a/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx b/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx index db45ffe7239..8eacd3b6719 100644 --- a/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx +++ b/packages/graphiql/src/components/__tests__/GraphiQL.spec.tsx @@ -11,7 +11,6 @@ import { GraphiQL } from '../GraphiQL'; import { Fetcher } from '@graphiql/toolkit'; import { ToolbarButton } from '@graphiql/react'; - // The smallest possible introspection result that builds a schema. const simpleIntrospection = { data: { diff --git a/packages/graphiql/test/e2e-server.js b/packages/graphiql/test/e2e-server.js index 2526c4b9cbc..f6473fef505 100644 --- a/packages/graphiql/test/e2e-server.js +++ b/packages/graphiql/test/e2e-server.js @@ -41,7 +41,7 @@ app.post('/graphql-error/graphql', (_req, res, next) => { }); app.use(express.static(path.resolve(__dirname, '../'))); -app.use('index.html', express.static(path.resolve(__dirname, '../dev.html'))) +app.use('index.html', express.static(path.resolve(__dirname, '../dev.html'))); app.listen(process.env.PORT || 0, function () { const { port } = this.address();