Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/http-response-empty-type
- Loading branch information
Showing
15 changed files
with
352 additions
and
156 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
export type DisposableSubscription = () => Promise<void> | void | ||
export type DisposableSubscription = () => void | ||
|
||
export class Disposable { | ||
protected subscriptions: Array<DisposableSubscription> = [] | ||
|
||
public async dispose() { | ||
await Promise.all(this.subscriptions.map((subscription) => subscription())) | ||
public dispose() { | ||
let subscription: DisposableSubscription | undefined | ||
while ((subscription = this.subscriptions.shift())) { | ||
subscription() | ||
} | ||
} | ||
} |
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,21 @@ | ||
import { InternalError } from './devUtils' | ||
|
||
describe(InternalError, () => { | ||
it('creates an InternalError instance', () => { | ||
const error = new InternalError('Message') | ||
|
||
expect(error.name).toBe('InternalError') | ||
expect(error.message).toBe('Message') | ||
expect(error.toString()).toBe('InternalError: Message') | ||
expect(error.stack).toMatch(/\w+/) | ||
}) | ||
|
||
it('passes the identity check', () => { | ||
const error = new InternalError('Message') | ||
expect(error instanceof InternalError).toBe(true) | ||
expect(error instanceof Error).toBe(true) | ||
|
||
const extraneousError = new Error('Message') | ||
expect(extraneousError).not.toBeInstanceOf(InternalError) | ||
}) | ||
}) |
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
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
Oops, something went wrong.