Move to websocket for requests to signal server
This commit is contained in:
parent
8449f343a6
commit
1c1d0e2da0
31 changed files with 1892 additions and 1336 deletions
26
ts/test-both/util/explodePromise_test.ts
Normal file
26
ts/test-both/util/explodePromise_test.ts
Normal file
|
@ -0,0 +1,26 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
/* eslint-disable no-restricted-syntax */
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { explodePromise } from '../../util/explodePromise';
|
||||
|
||||
describe('explodePromise', () => {
|
||||
it('resolves the promise', async () => {
|
||||
const { promise, resolve } = explodePromise<number>();
|
||||
|
||||
resolve(42);
|
||||
|
||||
assert.strictEqual(await promise, 42);
|
||||
});
|
||||
|
||||
it('rejects the promise', async () => {
|
||||
const { promise, reject } = explodePromise<number>();
|
||||
|
||||
reject(new Error('rejected'));
|
||||
|
||||
await assert.isRejected(promise, 'rejected');
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue