fix(tapbundle): treat tests that call tools.allowFailure() as passing and update tests to use tools parameter
This commit is contained in:
@@ -47,6 +47,7 @@ tap.test('metric test fast 3 - minimal work', async () => {
|
||||
|
||||
// Test to verify that failed tests still contribute to timing metrics
|
||||
tap.test('metric test that fails - 60ms before failure', async (tools) => {
|
||||
tools.allowFailure();
|
||||
await tools.delayFor(60);
|
||||
expect(true).toBeFalse(); // This will fail
|
||||
});
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { expect, tap } from '../../ts_tapbundle/index.js';
|
||||
|
||||
tap.test('This test should fail', async () => {
|
||||
tap.test('This test should fail', async (tools) => {
|
||||
tools.allowFailure();
|
||||
console.log('This test will fail on purpose');
|
||||
expect(true).toBeFalse();
|
||||
});
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
import { expect, tap } from '../../ts_tapbundle/index.js';
|
||||
|
||||
tap.test('Test that will fail with console logs', async () => {
|
||||
tap.test('Test that will fail with console logs', async (tools) => {
|
||||
tools.allowFailure();
|
||||
console.log('Starting the test...');
|
||||
console.log('Doing some setup work');
|
||||
console.log('About to check assertion');
|
||||
|
||||
|
||||
const value = 42;
|
||||
console.log(`The value is: ${value}`);
|
||||
|
||||
|
||||
// This will fail
|
||||
expect(value).toEqual(100);
|
||||
|
||||
|
||||
console.log('This log will not be reached');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user