2018-06-28 21:34:41 +00:00
|
|
|
import { tap, expect } from '../ts/index';
|
|
|
|
import * as randomstring from 'randomstring';
|
2017-10-10 15:14:14 +00:00
|
|
|
|
2018-06-28 21:34:41 +00:00
|
|
|
let test1 = tap.test('my first test -> expect true to be true', async tools => {
|
2017-10-10 15:14:14 +00:00
|
|
|
await tools.checkIterationLeak(async () => {
|
2018-06-28 21:34:41 +00:00
|
|
|
let domain = randomstring.generate(1000);
|
|
|
|
});
|
|
|
|
});
|
2017-10-10 15:14:14 +00:00
|
|
|
|
2018-06-28 21:34:41 +00:00
|
|
|
let outsideArray = [];
|
2017-10-10 15:14:14 +00:00
|
|
|
|
2018-06-28 21:34:41 +00:00
|
|
|
let test2 = tap.test('should throw', async tools => {
|
2017-10-10 15:14:14 +00:00
|
|
|
let err = await tools.returnError(async () => {
|
|
|
|
await tools.checkIterationLeak(async () => {
|
2018-06-28 21:34:41 +00:00
|
|
|
outsideArray.push(randomstring.generate(1000));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
expect(err).to.be.instanceof(Error);
|
|
|
|
});
|
2017-10-10 15:14:14 +00:00
|
|
|
|
2018-06-28 21:34:41 +00:00
|
|
|
tap.start();
|