2018-06-28 23:34:41 +02:00
|
|
|
import { tap, expect } from '../ts/index';
|
|
|
|
import * as randomstring from 'randomstring';
|
2017-10-10 17:14:14 +02:00
|
|
|
|
2020-07-08 00:17:25 +00:00
|
|
|
const test1 = tap.test('my first test -> expect true to be true', async (tools) => {
|
2017-10-10 17:14:14 +02:00
|
|
|
await tools.checkIterationLeak(async () => {
|
2019-04-10 12:56:17 +02:00
|
|
|
const domain = randomstring.generate(1000);
|
2018-06-28 23:34:41 +02:00
|
|
|
});
|
|
|
|
});
|
2017-10-10 17:14:14 +02:00
|
|
|
|
2019-04-10 12:56:17 +02:00
|
|
|
const outsideArray = [];
|
2017-10-10 17:14:14 +02:00
|
|
|
|
2020-07-08 00:17:25 +00:00
|
|
|
const test2 = tap.test('should throw', async (tools) => {
|
2019-04-10 12:56:17 +02:00
|
|
|
const err = await tools.returnError(async () => {
|
2017-10-10 17:14:14 +02:00
|
|
|
await tools.checkIterationLeak(async () => {
|
2018-06-28 23:34:41 +02:00
|
|
|
outsideArray.push(randomstring.generate(1000));
|
|
|
|
});
|
|
|
|
});
|
2019-08-22 23:57:27 +02:00
|
|
|
expect(err).to.be.undefined;
|
2018-06-28 23:34:41 +02:00
|
|
|
});
|
2017-10-10 17:14:14 +02:00
|
|
|
|
2018-06-28 23:34:41 +02:00
|
|
|
tap.start();
|