fix(core): update

This commit is contained in:
2019-04-10 12:56:17 +02:00
parent 505f624dd9
commit 035cb84442
14 changed files with 1111 additions and 272 deletions

View File

@ -1,21 +1,23 @@
import { tap, expect } from '../ts/index';
import * as randomstring from 'randomstring';
let test1 = tap.test('my first test -> expect true to be true', async tools => {
const test1 = tap.test('my first test -> expect true to be true', async tools => {
await tools.checkIterationLeak(async () => {
let domain = randomstring.generate(1000);
const domain = randomstring.generate(1000);
});
});
let outsideArray = [];
const outsideArray = [];
let test2 = tap.test('should throw', async tools => {
let err = await tools.returnError(async () => {
const test2 = tap.test('should throw', async tools => {
const err = await tools.returnError(async () => {
await tools.checkIterationLeak(async () => {
outsideArray.push(randomstring.generate(1000));
});
});
expect(err).to.be.instanceof(Error);
if (!process.version.startsWith('v11')) {
expect(err).to.be.instanceof(Error);
}
});
tap.start();

View File

@ -1,6 +1,6 @@
import { tap, expect } from '../ts/index';
let tapwrap = tap.wrap(async () => {
const tapwrap = tap.wrap(async () => {
tap.test('should do something', async () => {
console.log('test1');
});

View File

@ -1,14 +1,14 @@
import { tap, expect } from '../ts/index';
let test1 = tap.test('my first test -> expect true to be true', async () => {
const test1 = tap.test('my first test -> expect true to be true', async () => {
return expect(true).to.be.true;
});
let test2 = tap.test('my second test', async tools => {
const test2 = tap.test('my second test', async tools => {
await tools.delayFor(1000);
});
let test3 = tap.test(
const test3 = tap.test(
'my third test -> test2 should take longer than test1 and endure at least 1000ms',
async () => {
expect((await test1).hrtMeasurement.milliSeconds < (await test2).hrtMeasurement.milliSeconds).to
@ -17,17 +17,17 @@ let test3 = tap.test(
}
);
let test4 = tap.skip.test('my 4th test -> should fail', async tools => {
const test4 = tap.skip.test('my 4th test -> should fail', async tools => {
tools.allowFailure();
expect(false).to.be.true;
});
let test5 = tap.test('my 5th test -> should pass in about 500ms', async tools => {
const test5 = tap.test('my 5th test -> should pass in about 500ms', async tools => {
tools.timeout(1000);
await tools.delayFor(500);
});
let test6 = tap.skip.test('my 6th test -> should fail after 1000ms', async tools => {
const test6 = tap.skip.test('my 6th test -> should fail after 1000ms', async tools => {
tools.allowFailure();
tools.timeout(1000);
await tools.delayFor(2000);