Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed May 6, 2024
1 parent 9165f4a commit 8785c8a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
5 changes: 1 addition & 4 deletions js/packages/binderhub-client/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,7 @@ export class BinderRepository {
// setTimeout(() => this.close(), 1000);
return new EventIterator((queue) => {
this.eventIteratorQueue = queue;
const fail = (e) => {
// handle error, either in original fetch, or
};
const fetchPromise = fetchEventSource(this.buildUrl, {
fetchEventSource(this.buildUrl, {
headers,
// signal used for closing
signal: this.abortController.signal,
Expand Down
17 changes: 10 additions & 7 deletions js/packages/binderhub-client/tests/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,23 @@ import {
import { parseEventSource, simpleEventSourceServer } from "./utils";
import { readFileSync } from "node:fs";

async function wrapFetch(resource, options) {
/* like fetch, but ignore signal input
// abort signal shows up as uncaught in tests, despite working fine
*/
if (options) {
options.signal = null;
}
return fetch.apply(null, [resource, options]);
}

beforeAll(() => {
// inject globals for fetch
global.TextDecoder = TextDecoder;
if (!global.window) {
global.window = {};
}
if (!global.window.fetch) {
async function wrapFetch(resource, options) {
if (options) {
// abort signal shows up as uncaught in tests
options.signal = null;
}
return fetch.apply(null, [resource, options]);
}
global.window.fetch = wrapFetch;
}
});
Expand Down

0 comments on commit 8785c8a

Please sign in to comment.