fix(docs): refresh documentation and test timing tolerances for updated APIs
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* autocreated commitinfo by @push.rocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/tapbundle',
|
||||
version: '6.0.3',
|
||||
description: 'A comprehensive testing automation library that provides a wide range of utilities and tools for TAP (Test Anything Protocol) based testing, especially suitable for projects using tapbuffer.'
|
||||
name: '@git.zone/tstest/tapbundle',
|
||||
version: '3.6.5',
|
||||
description: 'Core TAP testing framework with enhanced assertions and lifecycle hooks.'
|
||||
}
|
||||
|
||||
+10
-28
@@ -2,6 +2,10 @@
|
||||
|
||||
> 🧪 Core TAP testing framework with enhanced assertions and lifecycle hooks
|
||||
|
||||
## Issue Reporting and Security
|
||||
|
||||
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
@@ -9,10 +13,6 @@
|
||||
pnpm install --save-dev @git.zone/tstest
|
||||
```
|
||||
|
||||
## Issue Reporting and Security
|
||||
|
||||
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
|
||||
|
||||
## Overview
|
||||
|
||||
`@git.zone/tstest/tapbundle` is the core testing framework module that provides the TAP (Test Anything Protocol) implementation for tstest. It offers a comprehensive API for writing and organizing tests with support for lifecycle hooks, test suites, enhanced assertions with diff generation, and flexible test configuration.
|
||||
@@ -393,21 +393,14 @@ tap.test('second test', async (tapTools) => {
|
||||
|
||||
```typescript
|
||||
// Define a fixture globally (outside tests)
|
||||
import { TapTools } from '@git.zone/tstest/tapbundle';
|
||||
import { tap, TapTools } from '@git.zone/tstest/tapbundle';
|
||||
|
||||
TapTools.defineFixture('database', async () => {
|
||||
const db = await createTestDatabase();
|
||||
return {
|
||||
value: db,
|
||||
cleanup: async () => await db.close()
|
||||
};
|
||||
});
|
||||
TapTools.defineFixture('database', async () => createTestDatabase());
|
||||
|
||||
// Use fixtures in tests
|
||||
tap.test('database test', async (tapTools) => {
|
||||
const db = await tapTools.fixture('database');
|
||||
// Use db...
|
||||
// Cleanup happens automatically
|
||||
});
|
||||
```
|
||||
|
||||
@@ -415,27 +408,16 @@ tap.test('database test', async (tapTools) => {
|
||||
|
||||
```typescript
|
||||
// Define a factory
|
||||
TapTools.defineFixture('user', async () => {
|
||||
return {
|
||||
value: null, // Not used for factories
|
||||
factory: async (data) => {
|
||||
return await createUser(data);
|
||||
},
|
||||
cleanup: async (user) => await user.delete()
|
||||
};
|
||||
});
|
||||
TapTools.defineFixture('user', async (data) => createUser(data));
|
||||
|
||||
// Use factory in tests
|
||||
tap.test('user test', async (tapTools) => {
|
||||
const user = await tapTools.factory('user').create({ name: 'Alice' });
|
||||
|
||||
// Create multiple
|
||||
const users = await tapTools.factory('user').createMany([
|
||||
{ name: 'Alice' },
|
||||
{ name: 'Bob' }
|
||||
]);
|
||||
|
||||
// Cleanup happens automatically
|
||||
const users = await tapTools.factory('user').createMany(2, (index) => ({
|
||||
name: index === 0 ? 'Alice' : 'Bob',
|
||||
}));
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user