-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d74517
commit 4ca9998
Showing
3 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { events } from 'fetch-event-stream'; | ||
|
||
test('ES /api/sse', async ({ baseURL }) => { | ||
const abortController = new AbortController(); | ||
const response = await fetch(`${baseURL}/api/sse`, { signal: abortController.signal }); | ||
const stream = events(response, abortController.signal); | ||
|
||
for await (const event of stream) { | ||
expect(event.data).toBe('Some message'); | ||
abortController.abort(); | ||
} | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.