mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-22 09:28:14 +01:00
Rename files
This commit is contained in:
24
ts/test-node/util/explodePromise_test.std.ts
Normal file
24
ts/test-node/util/explodePromise_test.std.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { explodePromise } from '../../util/explodePromise.std.js';
|
||||
|
||||
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');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user