tstest/test/tapbundle/test.fluent-syntax.ts

32 lines
864 B
TypeScript

import { tap, expect } from '../../ts_tapbundle/index.js';
// Test with fluent syntax
tap.tags('unit', 'fluent')
.priority('high')
.test('test with fluent syntax', async (toolsArg) => {
expect(true).toBeTrue();
toolsArg.context.set('fluentTest', 'works');
});
// Chain multiple settings
tap.tags('integration')
.priority('low')
.retry(3)
.timeout(5000)
.test('test with multiple settings', async (toolsArg) => {
expect(true).toBeTrue();
});
// Test context access from fluent test
tap.tags('unit')
.test('verify fluent context', async (toolsArg) => {
const fluentValue = toolsArg.context.get('fluentTest');
expect(fluentValue).toEqual('works');
});
// Test without tags - should show all tests run without filtering
tap.test('regular test without tags', async (toolsArg) => {
expect(true).toBeTrue();
});
tap.start();