Skip to content

Commit

Permalink
chore(packages/gqty): fix test for node 19
Browse files Browse the repository at this point in the history
  • Loading branch information
vicary committed Nov 27, 2022
1 parent 5c48796 commit 8354ca8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/gqty/test/ssr.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { renderToString } from 'react-dom/server';
import semver from 'semver';
import { waitForExpect } from 'test-utils';

import { createTestClient } from './utils';
Expand Down Expand Up @@ -111,7 +112,11 @@ describe('server side rendering', () => {
.spyOn(console, 'error')
.mockImplementation((message) => {
expect(message).toEqual(
SyntaxError('Unexpected token i in JSON at position 0')
SyntaxError(
semver.gte(process.version, '18.0.0')
? `Unexpected token 'i', "invalid" is not valid JSON`
: `Unexpected token i in JSON at position 0`
)
);
});

Expand Down

0 comments on commit 8354ca8

Please sign in to comment.