Skip to content

Commit 2082071

Browse files
chore(deps): lock file maintenance (#3897)
* chore(deps): lock file maintenance * Fix URQL tests --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
1 parent c016611 commit 2082071

File tree

2 files changed

+863
-985
lines changed

2 files changed

+863
-985
lines changed

packages/client/urql-exchange/__integration-tests__/urql-exchange.spec.ts

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { createServer, Server } from 'node:http';
2-
import { AddressInfo } from 'node:net';
31
import { setTimeout as setTimeout$ } from 'node:timers/promises';
42
import { ExecutionResult } from 'graphql';
53
import { createSchema, createYoga } from 'graphql-yoga';
@@ -9,7 +7,6 @@ import { Client, createClient } from '@urql/core';
97

108
describe('URQL Yoga Exchange', () => {
119
const endpoint = '/graphql';
12-
const hostname = '127.0.0.1';
1310
const yoga = createYoga({
1411
graphqlEndpoint: endpoint,
1512
logging: false,
@@ -29,10 +26,10 @@ describe('URQL Yoga Exchange', () => {
2926
`,
3027
resolvers: {
3128
Query: {
32-
hello: () => 'Hello Urql Client!',
29+
hello: async () => 'Hello Urql Client!',
3330
},
3431
Mutation: {
35-
readFile: (_, args: { file: File }) => args.file.text(),
32+
readFile: async (_, args: { file: File }) => args.file.text(),
3633
},
3734
Subscription: {
3835
time: {
@@ -42,34 +39,25 @@ describe('URQL Yoga Exchange', () => {
4239
yield new Date().toISOString();
4340
}
4441
},
45-
resolve: str => str,
42+
resolve: async str => str,
4643
},
4744
},
4845
},
4946
}),
5047
});
5148

52-
let server: Server;
53-
let url: string;
5449
let client: Client;
5550

5651
beforeAll(async () => {
57-
server = createServer(yoga);
58-
await new Promise<void>(resolve => server.listen(0, hostname, resolve));
59-
const port = (server.address() as AddressInfo).port;
60-
url = `http://${hostname}:${port}${endpoint}`;
6152
client = createClient({
62-
url,
53+
url: 'http://localhost:4000/graphql',
6354
exchanges: [
6455
yogaExchange({
6556
fetch: yoga.fetch as WindowOrWorkerGlobalScope['fetch'],
6657
}),
6758
],
6859
});
6960
});
70-
afterAll(done => {
71-
server.close(done);
72-
});
7361
it('should handle queries correctly', async () => {
7462
const result = await client
7563
.query(
@@ -127,7 +115,7 @@ describe('URQL Yoga Exchange', () => {
127115
expect(new Date(value!).getFullYear()).toBe(now.getFullYear());
128116
}
129117
});
130-
it.skip('should handle file uploads correctly', async () => {
118+
it('should handle file uploads correctly', async () => {
131119
const query = /* GraphQL */ `
132120
mutation readFile($file: File!) {
133121
readFile(file: $file)

0 commit comments

Comments
 (0)