@git.zone/tstest 2.4.2 β 2.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/package.json +1 -1
- package/readme.md +196 -122
- package/ts/00_commitinfo_data.ts +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@git.zone/tstest',
|
|
6
|
-
version: '2.4.
|
|
6
|
+
version: '2.4.3',
|
|
7
7
|
description: 'a test utility to run tests that match test/**/*.ts'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSxrQkFBa0I7SUFDeEIsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLHFEQUFxRDtDQUNuRSxDQUFBIn0=
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @git.zone/tstest
|
|
2
|
-
π§ͺ **A powerful, modern test runner for TypeScript** - making your test runs beautiful and informative!
|
|
2
|
+
π§ͺ **A powerful, modern test runner for TypeScript** - making your test runs beautiful and informative across multiple runtimes!
|
|
3
3
|
|
|
4
|
-
##
|
|
4
|
+
## Availability and Links
|
|
5
5
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@git.zone/tstest)
|
|
6
6
|
* [code.foss.global (source)](https://code.foss.global/git.zone/tstest)
|
|
7
7
|
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
### β¨ Key Features
|
|
13
13
|
|
|
14
14
|
- π― **Smart Test Execution** - Run all tests, single files, or use glob patterns
|
|
15
|
+
- π **Multi-Runtime Support** - Run tests in Node.js, Deno, Bun, and Chromium
|
|
15
16
|
- π¨ **Beautiful Output** - Color-coded results with emojis and clean formatting
|
|
16
17
|
- π **Multiple Output Modes** - Choose from normal, quiet, verbose, or JSON output
|
|
17
18
|
- π **Automatic Discovery** - Finds all your test files automatically
|
|
18
|
-
- π **Cross-Environment** - Supports Node.js and browser testing
|
|
19
19
|
- π **Detailed Logging** - Optional file logging for debugging
|
|
20
20
|
- β‘ **Performance Metrics** - See which tests are slow
|
|
21
21
|
- π€ **CI/CD Ready** - JSON output mode for automation
|
|
@@ -26,13 +26,10 @@
|
|
|
26
26
|
- β³ **Timeout Control** - Set custom timeouts for tests
|
|
27
27
|
- π **Retry Logic** - Automatically retry failing tests
|
|
28
28
|
- π οΈ **Test Fixtures** - Create reusable test data
|
|
29
|
-
- π¦ **Browser-Compatible** - Full browser support with embedded tapbundle
|
|
30
29
|
- π **Watch Mode** - Automatically re-run tests on file changes
|
|
31
30
|
- π **Real-time Progress** - Live test execution progress updates
|
|
32
31
|
- π¨ **Visual Diffs** - Beautiful side-by-side diffs for failed assertions
|
|
33
32
|
- π **Event-based Reporting** - Real-time test lifecycle events
|
|
34
|
-
- βοΈ **Test Configuration** - Flexible test settings with .tstest.json files
|
|
35
|
-
- π **Protocol V2** - Enhanced TAP protocol with Unicode delimiters
|
|
36
33
|
|
|
37
34
|
## Installation
|
|
38
35
|
|
|
@@ -42,6 +39,140 @@ npm install --save-dev @git.zone/tstest
|
|
|
42
39
|
pnpm add -D @git.zone/tstest
|
|
43
40
|
```
|
|
44
41
|
|
|
42
|
+
## Multi-Runtime Architecture
|
|
43
|
+
|
|
44
|
+
tstest supports running your tests across multiple JavaScript runtimes, allowing you to verify cross-platform compatibility easily.
|
|
45
|
+
|
|
46
|
+
### Supported Runtimes
|
|
47
|
+
|
|
48
|
+
- **Node.js** - Default runtime, uses tsrun for TypeScript execution
|
|
49
|
+
- **Chromium** - Browser environment testing with full DOM support
|
|
50
|
+
- **Deno** - Secure TypeScript/JavaScript runtime with modern features
|
|
51
|
+
- **Bun** - Ultra-fast all-in-one JavaScript runtime
|
|
52
|
+
|
|
53
|
+
### Test File Naming Convention
|
|
54
|
+
|
|
55
|
+
Name your test files with runtime specifiers to control where they run:
|
|
56
|
+
|
|
57
|
+
| Pattern | Runtimes | Example |
|
|
58
|
+
|---------|----------|---------|
|
|
59
|
+
| `*.ts` | Node.js only (default) | `test.api.ts` |
|
|
60
|
+
| `*.node.ts` | Node.js only | `test.server.node.ts` |
|
|
61
|
+
| `*.chromium.ts` | Chromium browser | `test.dom.chromium.ts` |
|
|
62
|
+
| `*.deno.ts` | Deno runtime | `test.http.deno.ts` |
|
|
63
|
+
| `*.bun.ts` | Bun runtime | `test.fast.bun.ts` |
|
|
64
|
+
| `*.node+chromium.ts` | Both Node.js and Chromium | `test.isomorphic.node+chromium.ts` |
|
|
65
|
+
| `*.node+deno.ts` | Both Node.js and Deno | `test.cross.node+deno.ts` |
|
|
66
|
+
| `*.deno+bun.ts` | Both Deno and Bun | `test.modern.deno+bun.ts` |
|
|
67
|
+
| `*.chromium.nonci.ts` | Chromium, skip in CI | `test.visual.chromium.nonci.ts` |
|
|
68
|
+
|
|
69
|
+
**Multi-Runtime Examples:**
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
// test.api.node+deno+bun.ts - runs in Node.js, Deno, and Bun
|
|
73
|
+
import { expect, tap } from '@git.zone/tstest/tapbundle';
|
|
74
|
+
|
|
75
|
+
tap.test('cross-runtime HTTP test', async () => {
|
|
76
|
+
const response = await fetch('https://api.example.com/test');
|
|
77
|
+
expect(response.status).toEqual(200);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
export default tap.start();
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Runtime Execution Order
|
|
84
|
+
|
|
85
|
+
When multiple runtimes are specified, tests execute in this order:
|
|
86
|
+
1. Node.js
|
|
87
|
+
2. Bun
|
|
88
|
+
3. Deno
|
|
89
|
+
4. Chromium
|
|
90
|
+
|
|
91
|
+
### Legacy Naming (Deprecated)
|
|
92
|
+
|
|
93
|
+
The following patterns are still supported but deprecated. Use the migration tool to update:
|
|
94
|
+
|
|
95
|
+
| Legacy Pattern | Modern Equivalent | Migration Command |
|
|
96
|
+
|----------------|-------------------|-------------------|
|
|
97
|
+
| `*.browser.ts` | `*.chromium.ts` | `tstest migrate` |
|
|
98
|
+
| `*.both.ts` | `*.node+chromium.ts` | `tstest migrate` |
|
|
99
|
+
|
|
100
|
+
When running legacy files, tstest shows a deprecation warning with the suggested new name.
|
|
101
|
+
|
|
102
|
+
### Migration Tool
|
|
103
|
+
|
|
104
|
+
Migrate your test files from legacy naming to the new convention:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# Dry run - see what would change
|
|
108
|
+
tstest migrate --dry-run
|
|
109
|
+
|
|
110
|
+
# Apply migrations (uses git mv to preserve history)
|
|
111
|
+
tstest migrate --write
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Migration Features:**
|
|
115
|
+
- β
Uses `git mv` to preserve file history
|
|
116
|
+
- β
Idempotent - safe to run multiple times
|
|
117
|
+
- β
Dry-run by default for safety
|
|
118
|
+
- β
Colored output showing all changes
|
|
119
|
+
- β
Handles modifiers like `.nonci` correctly
|
|
120
|
+
|
|
121
|
+
Example output:
|
|
122
|
+
```
|
|
123
|
+
============================================================
|
|
124
|
+
Test File Migration Tool
|
|
125
|
+
============================================================
|
|
126
|
+
|
|
127
|
+
π DRY RUN MODE - No files will be modified
|
|
128
|
+
|
|
129
|
+
Found 3 legacy test file(s)
|
|
130
|
+
|
|
131
|
+
Would migrate:
|
|
132
|
+
test.browser.ts
|
|
133
|
+
β test.chromium.ts
|
|
134
|
+
|
|
135
|
+
Would migrate:
|
|
136
|
+
test.both.ts
|
|
137
|
+
β test.node+chromium.ts
|
|
138
|
+
|
|
139
|
+
Would migrate:
|
|
140
|
+
test.auth.browser.nonci.ts
|
|
141
|
+
β test.auth.chromium.nonci.ts
|
|
142
|
+
|
|
143
|
+
============================================================
|
|
144
|
+
Summary:
|
|
145
|
+
Total legacy files: 3
|
|
146
|
+
Successfully migrated: 3
|
|
147
|
+
Errors: 0
|
|
148
|
+
============================================================
|
|
149
|
+
|
|
150
|
+
To apply these changes, run:
|
|
151
|
+
tstest migrate --write
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Runtime-Specific Permissions
|
|
155
|
+
|
|
156
|
+
#### Deno Runtime
|
|
157
|
+
|
|
158
|
+
Tests run with these permissions by default:
|
|
159
|
+
```bash
|
|
160
|
+
--allow-read
|
|
161
|
+
--allow-env
|
|
162
|
+
--allow-net
|
|
163
|
+
--allow-write
|
|
164
|
+
--allow-sys
|
|
165
|
+
--allow-import # Enables npm packages and Node.js built-ins
|
|
166
|
+
--node-modules-dir # Node.js compatibility mode
|
|
167
|
+
--sloppy-imports # Allows .js imports to resolve to .ts files
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Configure custom permissions in your test file or via environment variables.
|
|
171
|
+
|
|
172
|
+
#### Bun Runtime
|
|
173
|
+
|
|
174
|
+
Bun runs with its native TypeScript support and full access to Node.js APIs.
|
|
175
|
+
|
|
45
176
|
## Usage
|
|
46
177
|
|
|
47
178
|
### Basic Test Execution
|
|
@@ -92,18 +223,29 @@ tstest "test/unit/*.ts"
|
|
|
92
223
|
Pattern: test
|
|
93
224
|
Found: 4 test file(s)
|
|
94
225
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
226
|
+
βββ Part 1: Node.js βββ
|
|
227
|
+
|
|
228
|
+
βΆοΈ test/test.node+deno.ts (1/4)
|
|
229
|
+
Runtime: Node.js
|
|
230
|
+
β
HTTP request works (12ms)
|
|
231
|
+
β
JSON parsing works (3ms)
|
|
232
|
+
Summary: 2/2 PASSED in 1.2s
|
|
233
|
+
|
|
234
|
+
βββ Part 2: Deno βββ
|
|
235
|
+
|
|
236
|
+
βΆοΈ test/test.node+deno.ts (1/4)
|
|
237
|
+
Runtime: Deno
|
|
238
|
+
β
HTTP request works (15ms)
|
|
239
|
+
β
JSON parsing works (2ms)
|
|
240
|
+
Summary: 2/2 PASSED in 1.1s
|
|
99
241
|
|
|
100
242
|
π Test Summary
|
|
101
243
|
ββββββββββββββββββββββββββββββββββ
|
|
102
244
|
β Total Files: 4 β
|
|
103
|
-
β Total Tests:
|
|
104
|
-
β Passed:
|
|
245
|
+
β Total Tests: 8 β
|
|
246
|
+
β Passed: 8 β
|
|
105
247
|
β Failed: 0 β
|
|
106
|
-
β Duration:
|
|
248
|
+
β Duration: 2.4s β
|
|
107
249
|
ββββββββββββββββββββββββββββββββββ
|
|
108
250
|
|
|
109
251
|
ALL TESTS PASSED! π
|
|
@@ -141,19 +283,7 @@ Perfect for CI/CD pipelines:
|
|
|
141
283
|
{"event":"summary","summary":{"totalFiles":4,"totalTests":4,"totalPassed":4,"totalFailed":0,"totalDuration":542}}
|
|
142
284
|
```
|
|
143
285
|
|
|
144
|
-
##
|
|
145
|
-
|
|
146
|
-
tstest supports different test environments through file naming:
|
|
147
|
-
|
|
148
|
-
| Pattern | Environment | Example |
|
|
149
|
-
|---------|-------------|---------|
|
|
150
|
-
| `*.ts` | Node.js (default) | `test.basic.ts` |
|
|
151
|
-
| `*.node.ts` | Node.js only | `test.api.node.ts` |
|
|
152
|
-
| `*.chrome.ts` | Chrome browser | `test.dom.chrome.ts` |
|
|
153
|
-
| `*.browser.ts` | Browser environment | `test.ui.browser.ts` |
|
|
154
|
-
| `*.both.ts` | Both Node.js and browser | `test.isomorphic.both.ts` |
|
|
155
|
-
|
|
156
|
-
### Writing Tests with tapbundle
|
|
286
|
+
## Writing Tests with tapbundle
|
|
157
287
|
|
|
158
288
|
tstest includes tapbundle, a powerful TAP-based test framework. Import it from the embedded tapbundle:
|
|
159
289
|
|
|
@@ -165,7 +295,7 @@ tap.test('my awesome test', async () => {
|
|
|
165
295
|
expect(result).toEqual('expected value');
|
|
166
296
|
});
|
|
167
297
|
|
|
168
|
-
tap.start();
|
|
298
|
+
export default tap.start();
|
|
169
299
|
```
|
|
170
300
|
|
|
171
301
|
**Module Exports**
|
|
@@ -196,7 +326,7 @@ tap.test('async operations', async (tools) => {
|
|
|
196
326
|
});
|
|
197
327
|
|
|
198
328
|
// Start test execution
|
|
199
|
-
tap.start();
|
|
329
|
+
export default tap.start();
|
|
200
330
|
```
|
|
201
331
|
|
|
202
332
|
### Test Modifiers and Chaining
|
|
@@ -231,20 +361,20 @@ tap.timeout(5000)
|
|
|
231
361
|
```typescript
|
|
232
362
|
tap.describe('User Management', () => {
|
|
233
363
|
let testDatabase;
|
|
234
|
-
|
|
364
|
+
|
|
235
365
|
tap.beforeEach(async () => {
|
|
236
366
|
testDatabase = await createTestDB();
|
|
237
367
|
});
|
|
238
|
-
|
|
368
|
+
|
|
239
369
|
tap.afterEach(async () => {
|
|
240
370
|
await testDatabase.cleanup();
|
|
241
371
|
});
|
|
242
|
-
|
|
372
|
+
|
|
243
373
|
tap.test('should create user', async () => {
|
|
244
374
|
const user = await testDatabase.createUser({ name: 'John' });
|
|
245
375
|
expect(user.id).toBeDefined();
|
|
246
376
|
});
|
|
247
|
-
|
|
377
|
+
|
|
248
378
|
tap.describe('User Permissions', () => {
|
|
249
379
|
tap.test('should set admin role', async () => {
|
|
250
380
|
// Nested describe blocks
|
|
@@ -262,37 +392,37 @@ tap.test('using test tools', async (tools) => {
|
|
|
262
392
|
// Delay utilities
|
|
263
393
|
await tools.delayFor(1000); // delay for 1000ms
|
|
264
394
|
await tools.delayForRandom(100, 500); // random delay between 100-500ms
|
|
265
|
-
|
|
395
|
+
|
|
266
396
|
// Skip test conditionally
|
|
267
397
|
tools.skipIf(process.env.CI === 'true', 'Skipping in CI');
|
|
268
|
-
|
|
398
|
+
|
|
269
399
|
// Skip test unconditionally
|
|
270
400
|
if (!apiKeyAvailable) {
|
|
271
401
|
tools.skip('API key not available');
|
|
272
402
|
}
|
|
273
|
-
|
|
403
|
+
|
|
274
404
|
// Mark as todo
|
|
275
405
|
tools.todo('Needs implementation');
|
|
276
|
-
|
|
406
|
+
|
|
277
407
|
// Retry configuration
|
|
278
408
|
tools.retry(3); // Set retry count
|
|
279
|
-
|
|
409
|
+
|
|
280
410
|
// Timeout configuration
|
|
281
411
|
tools.timeout(10000); // Set timeout to 10s
|
|
282
|
-
|
|
412
|
+
|
|
283
413
|
// Context sharing between tests
|
|
284
414
|
tools.context.set('userId', 12345);
|
|
285
415
|
const userId = tools.context.get('userId');
|
|
286
|
-
|
|
416
|
+
|
|
287
417
|
// Deferred promises
|
|
288
418
|
const deferred = tools.defer();
|
|
289
419
|
setTimeout(() => deferred.resolve('done'), 100);
|
|
290
420
|
await deferred.promise;
|
|
291
|
-
|
|
421
|
+
|
|
292
422
|
// Colored console output
|
|
293
423
|
const coloredString = await tools.coloredString('Success!', 'green');
|
|
294
424
|
console.log(coloredString);
|
|
295
|
-
|
|
425
|
+
|
|
296
426
|
// Error handling helper
|
|
297
427
|
const error = await tools.returnError(async () => {
|
|
298
428
|
throw new Error('Expected error');
|
|
@@ -306,10 +436,10 @@ tap.test('using test tools', async (tools) => {
|
|
|
306
436
|
```typescript
|
|
307
437
|
tap.test('snapshot test', async (tools) => {
|
|
308
438
|
const output = generateComplexOutput();
|
|
309
|
-
|
|
439
|
+
|
|
310
440
|
// Compare with saved snapshot
|
|
311
441
|
await tools.matchSnapshot(output);
|
|
312
|
-
|
|
442
|
+
|
|
313
443
|
// Named snapshots for multiple checks in one test
|
|
314
444
|
await tools.matchSnapshot(output.header, 'header');
|
|
315
445
|
await tools.matchSnapshot(output.body, 'body');
|
|
@@ -339,9 +469,9 @@ tap.defineFixture('testPost', async (data) => ({
|
|
|
339
469
|
tap.test('fixture test', async (tools) => {
|
|
340
470
|
const user = await tools.fixture('testUser', { name: 'John' });
|
|
341
471
|
const post = await tools.fixture('testPost', { authorId: user.id });
|
|
342
|
-
|
|
472
|
+
|
|
343
473
|
expect(post.authorId).toEqual(user.id);
|
|
344
|
-
|
|
474
|
+
|
|
345
475
|
// Factory pattern for multiple instances
|
|
346
476
|
const users = await tools.factory('testUser').createMany(5);
|
|
347
477
|
expect(users).toHaveLength(5);
|
|
@@ -485,7 +615,7 @@ tap.test('first test', async (tools) => {
|
|
|
485
615
|
tap.test('second test', async (tools) => {
|
|
486
616
|
const sessionId = tools.context.get('sessionId');
|
|
487
617
|
expect(sessionId).toBeDefined();
|
|
488
|
-
|
|
618
|
+
|
|
489
619
|
// Cleanup
|
|
490
620
|
tools.context.delete('sessionId');
|
|
491
621
|
});
|
|
@@ -506,9 +636,9 @@ tap.test('DOM manipulation', async () => {
|
|
|
506
636
|
<button id="test-btn">Click Me</button>
|
|
507
637
|
</div>
|
|
508
638
|
`);
|
|
509
|
-
|
|
639
|
+
|
|
510
640
|
expect(element.querySelector('h1').textContent).toEqual('Test Title');
|
|
511
|
-
|
|
641
|
+
|
|
512
642
|
// Simulate interactions
|
|
513
643
|
const button = element.querySelector('#test-btn');
|
|
514
644
|
button.click();
|
|
@@ -521,7 +651,7 @@ tap.test('CSS testing', async () => {
|
|
|
521
651
|
font-size: 16px;
|
|
522
652
|
}
|
|
523
653
|
`;
|
|
524
|
-
|
|
654
|
+
|
|
525
655
|
// styles is a string that can be injected into the page
|
|
526
656
|
expect(styles).toInclude('color: red');
|
|
527
657
|
});
|
|
@@ -535,7 +665,7 @@ tap.test('error handling', async (tools) => {
|
|
|
535
665
|
const error = await tools.returnError(async () => {
|
|
536
666
|
await functionThatThrows();
|
|
537
667
|
});
|
|
538
|
-
|
|
668
|
+
|
|
539
669
|
expect(error).toBeInstanceOf(Error);
|
|
540
670
|
expect(error.message).toEqual('Expected error message');
|
|
541
671
|
});
|
|
@@ -612,7 +742,7 @@ When assertions fail, tstest shows beautiful side-by-side diffs:
|
|
|
612
742
|
String Diff:
|
|
613
743
|
- Expected
|
|
614
744
|
+ Received
|
|
615
|
-
|
|
745
|
+
|
|
616
746
|
- Hello World
|
|
617
747
|
+ Hello Universe
|
|
618
748
|
|
|
@@ -625,73 +755,6 @@ When assertions fail, tstest shows beautiful side-by-side diffs:
|
|
|
625
755
|
}
|
|
626
756
|
```
|
|
627
757
|
|
|
628
|
-
### Test Configuration (.tstest.json)
|
|
629
|
-
|
|
630
|
-
Configure test behavior with `.tstest.json` files:
|
|
631
|
-
|
|
632
|
-
```json
|
|
633
|
-
{
|
|
634
|
-
"timeout": 30000,
|
|
635
|
-
"retries": 2,
|
|
636
|
-
"bail": false,
|
|
637
|
-
"parallel": true,
|
|
638
|
-
"tags": ["unit", "fast"],
|
|
639
|
-
"env": {
|
|
640
|
-
"NODE_ENV": "test"
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
```
|
|
644
|
-
|
|
645
|
-
Configuration files are discovered in:
|
|
646
|
-
1. Test file directory
|
|
647
|
-
2. Parent directories (up to project root)
|
|
648
|
-
3. Project root
|
|
649
|
-
4. Home directory (`~/.tstest.json`)
|
|
650
|
-
|
|
651
|
-
Settings cascade and merge, with closer files taking precedence.
|
|
652
|
-
|
|
653
|
-
### Event-based Test Reporting
|
|
654
|
-
|
|
655
|
-
tstest emits detailed events during test execution for integration with CI/CD tools:
|
|
656
|
-
|
|
657
|
-
```json
|
|
658
|
-
{"event":"suite:started","file":"test/api.test.ts","timestamp":"2025-05-26T10:30:00.000Z"}
|
|
659
|
-
{"event":"test:started","name":"api endpoint validation","timestamp":"2025-05-26T10:30:00.100Z"}
|
|
660
|
-
{"event":"test:progress","name":"api endpoint validation","message":"Validating response schema"}
|
|
661
|
-
{"event":"test:completed","name":"api endpoint validation","passed":true,"duration":145}
|
|
662
|
-
{"event":"suite:completed","file":"test/api.test.ts","passed":true,"total":2,"failed":0}
|
|
663
|
-
```
|
|
664
|
-
|
|
665
|
-
### Enhanced TAP Protocol (Protocol V2)
|
|
666
|
-
|
|
667
|
-
tstest uses an enhanced TAP protocol with Unicode delimiters for better parsing:
|
|
668
|
-
|
|
669
|
-
```
|
|
670
|
-
β¦TSTEST:EVENT:test:startedβ§{"name":"my test","timestamp":"2025-05-26T10:30:00.000Z"}
|
|
671
|
-
ok 1 my test
|
|
672
|
-
β¦TSTEST:EVENT:test:completedβ§{"name":"my test","passed":true,"duration":145}
|
|
673
|
-
```
|
|
674
|
-
|
|
675
|
-
This prevents conflicts with test output that might contain TAP-like formatting.
|
|
676
|
-
|
|
677
|
-
## Advanced Features
|
|
678
|
-
|
|
679
|
-
### Glob Pattern Support
|
|
680
|
-
|
|
681
|
-
Run specific test patterns:
|
|
682
|
-
```bash
|
|
683
|
-
# Run all unit tests
|
|
684
|
-
tstest "test/unit/**/*.ts"
|
|
685
|
-
|
|
686
|
-
# Run all integration tests
|
|
687
|
-
tstest "test/integration/*.test.ts"
|
|
688
|
-
|
|
689
|
-
# Run multiple patterns
|
|
690
|
-
tstest "test/**/*.spec.ts" "test/**/*.test.ts"
|
|
691
|
-
```
|
|
692
|
-
|
|
693
|
-
**Important**: Always quote glob patterns to prevent shell expansion. Without quotes, the shell will expand the pattern and only pass the first matching file to tstest.
|
|
694
|
-
|
|
695
758
|
### Enhanced Test Logging
|
|
696
759
|
|
|
697
760
|
The `--logfile` option provides intelligent test logging with automatic organization:
|
|
@@ -849,6 +912,17 @@ tstest test/api/endpoints.test.ts --verbose --timeout 60
|
|
|
849
912
|
|
|
850
913
|
## Changelog
|
|
851
914
|
|
|
915
|
+
### Version 2.4.0
|
|
916
|
+
- π **Multi-Runtime Architecture** - Support for Deno, Bun, Node.js, and Chromium
|
|
917
|
+
- π **New Naming Convention** - Flexible `.runtime1+runtime2.ts` pattern
|
|
918
|
+
- π **Migration Tool** - Easy migration from legacy naming (`.browser.ts`, `.both.ts`)
|
|
919
|
+
- π¦ **Deno Support** - Full Deno runtime with Node.js compatibility
|
|
920
|
+
- π° **Bun Support** - Ultra-fast Bun runtime integration
|
|
921
|
+
- β‘ **Dynamic Port Selection** - Random port allocation (30000-40000) prevents conflicts
|
|
922
|
+
- ποΈ **Runtime Adapter Pattern** - Extensible architecture for adding new runtimes
|
|
923
|
+
- π **Deprecation Warnings** - Helpful migration suggestions for legacy naming
|
|
924
|
+
- β
**Comprehensive Tests** - Full test coverage for parser and migration tool
|
|
925
|
+
|
|
852
926
|
### Version 1.11.0
|
|
853
927
|
- π Added Watch Mode with `--watch`/`-w` flag for automatic test re-runs
|
|
854
928
|
- π Implemented real-time test progress updates with event streaming
|
|
@@ -878,7 +952,7 @@ tstest test/api/endpoints.test.ts --verbose --timeout 60
|
|
|
878
952
|
- π Improved internal protocol design documentation
|
|
879
953
|
- π§ Added protocol v2 utilities for future improvements
|
|
880
954
|
|
|
881
|
-
### Version 1.9.1
|
|
955
|
+
### Version 1.9.1
|
|
882
956
|
- π Fixed log file naming to preserve directory structure
|
|
883
957
|
- π Log files now prevent collisions: `test__dir__file.log`
|
|
884
958
|
|
|
@@ -901,7 +975,7 @@ tstest test/api/endpoints.test.ts --verbose --timeout 60
|
|
|
901
975
|
|
|
902
976
|
## License and Legal Information
|
|
903
977
|
|
|
904
|
-
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license
|
|
978
|
+
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
|
905
979
|
|
|
906
980
|
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
|
907
981
|
|
|
@@ -911,9 +985,9 @@ This project is owned and maintained by Task Venture Capital GmbH. The names and
|
|
|
911
985
|
|
|
912
986
|
### Company Information
|
|
913
987
|
|
|
914
|
-
Task Venture Capital GmbH
|
|
988
|
+
Task Venture Capital GmbH
|
|
915
989
|
Registered at District court Bremen HRB 35230 HB, Germany
|
|
916
990
|
|
|
917
991
|
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
|
|
918
992
|
|
|
919
|
-
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
|
993
|
+
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|