BREAKING CHANGE(core): switxh to @pushrocks/smartexpect

This commit is contained in:
2022-01-21 19:54:07 +01:00
parent 22df58b8bc
commit 0884da7941
6 changed files with 85 additions and 34 deletions

View File

@ -6,12 +6,12 @@ tap.preTask('custompretask', async () => {
tap.test('should have access to webhelpers', async () => {
const myElement = await webhelpers.fixture(webhelpers.html`<div></div>`);
expect(myElement).to.be.instanceOf(HTMLElement);
expect(myElement).toBeInstanceOf(HTMLElement);
console.log(myElement);
});
const test1 = tap.test('my first test -> expect true to be true', async () => {
return expect(true).to.be.true;
return expect(true).toBeTrue();
});
const test2 = tap.test('my second test', async (tools) => {
@ -21,15 +21,14 @@ const test2 = tap.test('my second test', async (tools) => {
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
.be.true;
expect((await test2).hrtMeasurement.milliSeconds > 10).to.be.true;
expect((await test1).hrtMeasurement.milliSeconds < (await test2).hrtMeasurement.milliSeconds).toBeTrue();
expect((await test2).hrtMeasurement.milliSeconds > 10).toBeTrue();
}
);
const test4 = tap.skip.test('my 4th test -> should fail', async (tools) => {
tools.allowFailure();
expect(false).to.be.true;
expect(false).toBeTrue();
});
const test5 = tap.test('my 5th test -> should pass in about 500ms', async (tools) => {

View File

@ -5,7 +5,7 @@ tap.preTask('hi there', async () => {
});
const test1 = tap.test('my first test -> expect true to be true', async () => {
return expect(true).to.be.true;
return expect(true).toBeTrue();
});
const test2 = tap.test('my second test', async (tools) => {
@ -18,14 +18,14 @@ const test3 = tap.test(
expect(
(await test1.testPromise).hrtMeasurement.milliSeconds <
(await test2).hrtMeasurement.milliSeconds
).to.be.true;
expect((await test2.testPromise).hrtMeasurement.milliSeconds > 1000).to.be.true;
).toBeTrue();
expect((await test2.testPromise).hrtMeasurement.milliSeconds > 1000).toBeTrue();
}
);
const test4 = tap.test('my 4th test -> should fail', async (tools) => {
tools.allowFailure();
expect(false).to.be.false;
expect(false).toBeFalse();
return 'hello';
});