fix(core): update
This commit is contained in:
parent
984c2bc9d8
commit
63dd46ed49
16
test/test.ts
16
test/test.ts
@ -1,27 +1,27 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as q from '../ts/index';
|
||||
import * as smartpromise from '../ts/index';
|
||||
|
||||
tap.test('should return a Deferred for .defer()', async () => {
|
||||
let myDeferred = q.defer();
|
||||
let expectPromise = expect(myDeferred.promise).to.eventually.be.fulfilled;
|
||||
const myDeferred = smartpromise.defer();
|
||||
const expectPromise = expect(myDeferred.promise).to.eventually.be.fulfilled;
|
||||
myDeferred.resolve();
|
||||
return expectPromise;
|
||||
});
|
||||
|
||||
tap.test('should let types flow through the Promise', async () => {
|
||||
let myString = 'someString';
|
||||
let myDeferred = q.defer<string>();
|
||||
let expectPromise = expect(myDeferred.promise).to.eventually.equal('someString');
|
||||
const myString = 'someString';
|
||||
const myDeferred = smartpromise.defer<string>();
|
||||
const expectPromise = expect(myDeferred.promise).to.eventually.equal('someString');
|
||||
myDeferred.resolve(myString);
|
||||
return expectPromise;
|
||||
});
|
||||
|
||||
tap.test('should map callbacks', async () => {
|
||||
let inputArray = ['hi', 'awesome'];
|
||||
const inputArray = ['hi', 'awesome'];
|
||||
const myPromisified = async myInput => {
|
||||
return myInput;
|
||||
};
|
||||
const expectPromise = expect(q.map(inputArray, myPromisified)).to.eventually.deep.equal(
|
||||
const expectPromise = expect(smartpromise.map(inputArray, myPromisified)).to.eventually.deep.equal(
|
||||
inputArray
|
||||
);
|
||||
return expectPromise;
|
||||
|
Loading…
x
Reference in New Issue
Block a user