Skip to content

Commit 5b091a4

Browse files
chore(deps): upgrade to eventsource v3
1 parent 08bd12b commit 5b091a4

File tree

6 files changed

+55
-15
lines changed

6 files changed

+55
-15
lines changed

integration/nest-application/sse/e2e/express.spec.ts

+17-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { NestExpressApplication } from '@nestjs/platform-express';
22
import { Test } from '@nestjs/testing';
33
import { expect } from 'chai';
4-
import * as EventSource from 'eventsource';
4+
import { EventSource } from 'eventsource';
55
import { AppModule } from '../src/app.module';
66

77
describe('Sse (Express Application)', () => {
@@ -20,7 +20,14 @@ describe('Sse (Express Application)', () => {
2020
const url = await app.getUrl();
2121

2222
eventSource = new EventSource(url + '/sse', {
23-
headers: { connection: 'keep-alive' },
23+
fetch: (input, init) =>
24+
fetch(input, {
25+
...init,
26+
headers: {
27+
...init.headers,
28+
connection: 'keep-alive',
29+
},
30+
}),
2431
});
2532
});
2633

@@ -57,7 +64,14 @@ describe('Sse (Express Application)', () => {
5764
const url = await app.getUrl();
5865

5966
eventSource = new EventSource(url + '/sse', {
60-
headers: { connection: 'keep-alive' },
67+
fetch: (input, init) =>
68+
fetch(input, {
69+
...init,
70+
headers: {
71+
...init.headers,
72+
connection: 'keep-alive',
73+
},
74+
}),
6175
});
6276
});
6377

integration/nest-application/sse/e2e/fastify.spec.ts

+17-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
} from '@nestjs/platform-fastify';
55
import { Test } from '@nestjs/testing';
66
import { expect } from 'chai';
7-
import * as EventSource from 'eventsource';
7+
import { EventSource } from 'eventsource';
88
import { AppModule } from '../src/app.module';
99

1010
describe('Sse (Fastify Application)', () => {
@@ -25,7 +25,14 @@ describe('Sse (Fastify Application)', () => {
2525
const url = await app.getUrl();
2626

2727
eventSource = new EventSource(url + '/sse', {
28-
headers: { connection: 'keep-alive' },
28+
fetch: (input, init) =>
29+
fetch(input, {
30+
...init,
31+
headers: {
32+
...init.headers,
33+
connection: 'keep-alive',
34+
},
35+
}),
2936
});
3037
});
3138

@@ -64,7 +71,14 @@ describe('Sse (Fastify Application)', () => {
6471
const url = await app.getUrl();
6572

6673
eventSource = new EventSource(url + '/sse', {
67-
headers: { connection: 'keep-alive' },
74+
fetch: (input, init) =>
75+
fetch(input, {
76+
...init,
77+
headers: {
78+
...init.headers,
79+
connection: 'keep-alive',
80+
},
81+
}),
6882
});
6983
});
7084

integration/websockets/e2e/gateway.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { INestApplication } from '@nestjs/common';
22
import { Test } from '@nestjs/testing';
33
import { expect } from 'chai';
4-
import * as EventSource from 'eventsource';
4+
import { EventSource } from 'eventsource';
55
import { io } from 'socket.io-client';
66
import { AppController as LongConnectionController } from '../../nest-application/sse/src/app.controller';
77
import { ApplicationGateway } from '../src/app.gateway';

package-lock.json

+17-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,13 @@
130130
"eslint-config-prettier": "9.1.0",
131131
"eslint-plugin-import": "2.31.0",
132132
"eslint-plugin-prettier": "5.2.1",
133-
"eventsource": "2.0.2",
133+
"eventsource": "3.0.2",
134134
"fancy-log": "2.0.0",
135135
"fastify": "5.2.1",
136136
"globals": "15.12.0",
137137
"graphql": "16.9.0",
138-
"graphql-tools": "9.0.8",
139138
"graphql-subscriptions": "2.0.0",
139+
"graphql-tools": "9.0.8",
140140
"gulp": "5.0.0",
141141
"gulp-clang-format": "1.0.27",
142142
"gulp-clean": "0.4.0",

packages/core/test/router/sse-stream.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from 'chai';
2-
import * as EventSource from 'eventsource';
2+
import { EventSource } from 'eventsource';
33
import { createServer, OutgoingHttpHeaders } from 'http';
44
import { AddressInfo } from 'net';
55
import { Writable } from 'stream';

0 commit comments

Comments
 (0)