Skip to content

Commit 1ebe66b

Browse files
committed
fix import of node-fetch ESM-only package
1 parent 09b07f0 commit 1ebe66b

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

spec/ParseGraphQLServer.spec.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const http = require('http');
22
const express = require('express');
33
const req = require('../lib/request');
4-
const fetch = require('node-fetch');
4+
const fetch = (...args) => import('node-fetch').then(({ default: fetch }) => fetch(...args));
55
const FormData = require('form-data');
66
const ws = require('ws');
77
require('./helper');
@@ -61,7 +61,7 @@ describe('ParseGraphQLServer', () => {
6161
expect(() => new ParseGraphQLServer()).toThrow('You must provide a parseServer instance!');
6262
});
6363

64-
it('should require config.graphQLPath', () => {
64+
fit('should require config.graphQLPath', () => {
6565
expect(() => new ParseGraphQLServer(parseServer)).toThrow(
6666
'You must provide a config.graphQLPath!'
6767
);
@@ -2600,18 +2600,22 @@ describe('ParseGraphQLServer', () => {
26002600
// "SecondaryObject:bBRgmzIRRM" < "SecondaryObject:nTMcuVbATY" true
26012601
// base64("SecondaryObject:bBRgmzIRRM"") < base64(""SecondaryObject:nTMcuVbATY"") false
26022602
// "U2Vjb25kYXJ5T2JqZWN0OmJCUmdteklSUk0=" < "U2Vjb25kYXJ5T2JqZWN0Om5UTWN1VmJBVFk=" false
2603-
const originalIds = [getSecondaryObjectsResult.data.secondaryObject2.objectId,
2604-
getSecondaryObjectsResult.data.secondaryObject4.objectId];
2603+
const originalIds = [
2604+
getSecondaryObjectsResult.data.secondaryObject2.objectId,
2605+
getSecondaryObjectsResult.data.secondaryObject4.objectId,
2606+
];
26052607
expect(
26062608
findSecondaryObjectsResult.data.secondaryObjects.edges[0].node.objectId
2607-
).not.toBe(
2608-
findSecondaryObjectsResult.data.secondaryObjects.edges[1].node.objectId
2609-
);
2609+
).not.toBe(findSecondaryObjectsResult.data.secondaryObjects.edges[1].node.objectId);
26102610
expect(
2611-
originalIds.includes(findSecondaryObjectsResult.data.secondaryObjects.edges[0].node.objectId)
2611+
originalIds.includes(
2612+
findSecondaryObjectsResult.data.secondaryObjects.edges[0].node.objectId
2613+
)
26122614
).toBeTrue();
26132615
expect(
2614-
originalIds.includes(findSecondaryObjectsResult.data.secondaryObjects.edges[1].node.objectId)
2616+
originalIds.includes(
2617+
findSecondaryObjectsResult.data.secondaryObjects.edges[1].node.objectId
2618+
)
26152619
).toBeTrue();
26162620

26172621
const createPrimaryObjectResult = await apolloClient.mutate({

0 commit comments

Comments
 (0)