Compare commits

...

6 Commits

12 changed files with 1141 additions and 2065 deletions

View File

@@ -1,5 +1,27 @@
# Changelog
## 2026-03-18 - 3.4.0 - feat(tapbundle,deno)
replace smarts3 test tooling with smartstorage and pre-resolve Deno test dependencies
- switch TapNodeTools storage helper from @push.rocks/smarts3 to @push.rocks/smartstorage and rename createSmarts3() to createSmartStorage()
- update node tests and tapbundle server-side documentation to use the new smartstorage helper
- run `deno install --entrypoint` before executing Deno tests to resolve dependencies up front
- bump supporting development dependencies including @types/node and @push.rocks/smartshell
## 2026-03-09 - 3.3.2 - fix(deps)
bump dependency versions and reorder smartserve in package.json
- bump @push.rocks/smartbrowser from ^2.0.10 to ^2.0.11
- bump @push.rocks/smartfs from ^1.4.0 to ^1.5.0
- move @push.rocks/smartserve to later position in dependencies (version unchanged: ^2.0.1)
## 2026-03-09 - 3.3.1 - fix(serve)
migrate test HTTP server to @push.rocks/smartserve and update related dependencies
- Replace @api.global/typedserver with @push.rocks/smartserve and FileServer; use SmartServe.setHandler to serve static assets and a custom /test response.
- Export smartserve from ts/tstest.plugins.ts and remove typedserver import/export.
- Update package.json dependencies: add @push.rocks/smartserve@^2.0.1 and bump @push.rocks/smartbrowser to ^2.0.10.
## 2026-03-06 - 3.3.0 - feat(testfile-directives)
Add per-test file directives to control runtime permissions and flags (Deno, Node, Bun, Chromium)

View File

@@ -9,5 +9,5 @@
"target": "ES2022"
},
"nodeModulesDir": true,
"version": "3.3.0"
"version": "3.4.0"
}

View File

@@ -1,6 +1,6 @@
{
"name": "@git.zone/tstest",
"version": "3.3.0",
"version": "3.4.0",
"private": false,
"description": "A powerful, modern test runner for TypeScript with multi-runtime support (Node.js, Deno, Bun, Chromium) and a batteries-included test framework.",
"exports": {
@@ -26,21 +26,20 @@
},
"devDependencies": {
"@git.zone/tsbuild": "^4.3.0",
"@types/node": "^25.3.5"
"@types/node": "^25.5.0"
},
"dependencies": {
"@api.global/typedserver": "^8.4.2",
"@git.zone/tsbundle": "^2.9.1",
"@git.zone/tsrun": "^2.0.1",
"@push.rocks/consolecolor": "^2.0.3",
"@push.rocks/qenv": "^6.1.3",
"@push.rocks/smartbrowser": "^2.0.8",
"@push.rocks/smartbrowser": "^2.0.11",
"@push.rocks/smartcrypto": "^2.0.4",
"@push.rocks/smartdelay": "^3.0.5",
"@push.rocks/smartenv": "^6.0.0",
"@push.rocks/smartexpect": "^2.5.0",
"@push.rocks/smartfile": "^13.1.2",
"@push.rocks/smartfs": "^1.4.0",
"@push.rocks/smartfs": "^1.5.0",
"@push.rocks/smartjson": "^6.0.0",
"@push.rocks/smartlog": "^3.2.1",
"@push.rocks/smartmongo": "^5.1.0",
@@ -48,8 +47,9 @@
"@push.rocks/smartpath": "^6.0.0",
"@push.rocks/smartpromise": "^4.2.3",
"@push.rocks/smartrequest": "^5.0.1",
"@push.rocks/smarts3": "^5.3.0",
"@push.rocks/smartshell": "^3.3.7",
"@push.rocks/smartserve": "^2.0.1",
"@push.rocks/smartshell": "^3.3.8",
"@push.rocks/smartstorage": "^6.0.1",
"@push.rocks/smarttime": "^4.2.3",
"@push.rocks/smartwatch": "^6.3.0",
"@types/ws": "^8.18.1",

3045
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -20,9 +20,9 @@ tap.test('should create a smartmongo instance', async () => {
await smartmongo.stop();
});
tap.test('should create a smarts3 instance', async () => {
const smarts3 = await tapNodeTools.createSmarts3();
await smarts3.stop();
tap.test('should create a smartstorage instance', async () => {
const smartstorage = await tapNodeTools.createSmartStorage();
await smartstorage.stop();
});
tap.start();

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@git.zone/tstest',
version: '3.3.0',
version: '3.4.0',
description: 'A powerful, modern test runner for TypeScript with multi-runtime support (Node.js, Deno, Bun, Chromium) and a batteries-included test framework.'
}

View File

@@ -116,24 +116,27 @@ export class ChromiumRuntimeAdapter extends RuntimeAdapter {
// Find free ports for HTTP and WebSocket
const { httpPort, wsPort } = await this.findFreePorts();
// lets create a server
const server = new plugins.typedserver.TypedServer({
cors: true,
port: httpPort,
serveDir: tsbundleCacheDirPath,
});
server.addRoute('/test', 'GET', async () => {
return new Response(`
<html>
<head>
<script>
globalThis.testdom = true;
globalThis.wsPort = ${wsPort};
</script>
</head>
<body></body>
</html>
`, { headers: { 'Content-Type': 'text/html' } });
// Use SmartServe with setHandler() to bypass global ControllerRegistry
const fileServer = new plugins.smartserve.FileServer({ root: tsbundleCacheDirPath });
const server = new plugins.smartserve.SmartServe({ port: httpPort });
server.setHandler(async (request: Request) => {
const url = new URL(request.url);
if (url.pathname === '/test') {
return new Response(`
<html>
<head>
<script>
globalThis.testdom = true;
globalThis.wsPort = ${wsPort};
</script>
</head>
<body></body>
</html>
`, { headers: { 'Content-Type': 'text/html' } });
}
const staticResponse = await fileServer.serve(request);
if (staticResponse) return staticResponse;
return new Response('Not Found', { status: 404 });
});
await server.start();

View File

@@ -190,6 +190,17 @@ import '${absoluteTestFile.replace(/\\/g, '/')}';
runCommand = `${loaderCommand.command} ${loaderCommand.args.join(' ')}`;
}
// Pre-resolve dependencies for the Deno test entrypoint
const installTarget = loaderPath || testFile;
const installArgs = ['install', '--entrypoint', installTarget];
if (mergedOptions.configPath) {
installArgs.push('--config', mergedOptions.configPath);
}
const installCommand = `deno ${installArgs.join(' ')}`;
console.log(cs(` ⏳ Resolving Deno dependencies for ${plugins.path.basename(testFile)}...`, 'blue'));
await this.smartshellInstance.execSilent(installCommand, { cwd: process.cwd() });
console.log(cs(` ✓ Deno dependencies resolved`, 'green'));
const execResultStreaming = await this.smartshellInstance.execStreamingSilent(runCommand);
// If we created a loader file, clean it up after test execution

View File

@@ -476,24 +476,27 @@ import '${absoluteTestFile.replace(/\\/g, '/')}';
// Find free ports for HTTP and WebSocket
const { httpPort, wsPort } = await this.findFreePorts();
// lets create a server
const server = new plugins.typedserver.TypedServer({
cors: true,
port: httpPort,
serveDir: tsbundleCacheDirPath,
});
server.addRoute('/test', 'GET', async () => {
return new Response(`
<html>
<head>
<script>
globalThis.testdom = true;
globalThis.wsPort = ${wsPort};
</script>
</head>
<body></body>
</html>
`, { headers: { 'Content-Type': 'text/html' } });
// Use SmartServe with setHandler() to bypass global ControllerRegistry
const fileServer = new plugins.smartserve.FileServer({ root: tsbundleCacheDirPath });
const server = new plugins.smartserve.SmartServe({ port: httpPort });
server.setHandler(async (request: Request) => {
const url = new URL(request.url);
if (url.pathname === '/test') {
return new Response(`
<html>
<head>
<script>
globalThis.testdom = true;
globalThis.wsPort = ${wsPort};
</script>
</head>
<body></body>
</html>
`, { headers: { 'Content-Type': 'text/html' } });
}
const staticResponse = await fileServer.serve(request);
if (staticResponse) return staticResponse;
return new Response('Not Found', { status: 404 });
});
await server.start();

View File

@@ -4,16 +4,10 @@ import * as path from 'path';
export { fs, path };
// @apiglobal scope
import * as typedserver from '@api.global/typedserver';
export {
typedserver
}
// @push.rocks scope
import * as consolecolor from '@push.rocks/consolecolor';
import * as smartbrowser from '@push.rocks/smartbrowser';
import * as smartserve from '@push.rocks/smartserve';
import * as smartdelay from '@push.rocks/smartdelay';
import * as smartfile from '@push.rocks/smartfile';
import * as smartfs from '@push.rocks/smartfs';
@@ -28,6 +22,7 @@ import * as tapbundle from '../dist_ts_tapbundle/index.js';
export {
consolecolor,
smartbrowser,
smartserve,
smartdelay,
smartfile,
smartfs,

View File

@@ -83,16 +83,15 @@ class TapNodeTools {
}
/**
* create and return a smarts3 instance
* create and return a smartstorage instance
*/
public async createSmarts3() {
const smarts3Mod = await import('@push.rocks/smarts3');
const smarts3Instance = new smarts3Mod.Smarts3({
public async createSmartStorage() {
const smartstorageMod = await import('@push.rocks/smartstorage');
const smartstorageInstance = await smartstorageMod.SmartStorage.createAndStart({
server: { port: 3003 },
storage: { cleanSlate: true },
});
await smarts3Instance.start();
return smarts3Instance;
return smartstorageInstance;
}
// ============

View File

@@ -207,12 +207,12 @@ Uses [@push.rocks/smartmongo](https://code.foss.global/push.rocks/smartmongo).
Create a local S3-compatible storage instance for testing.
```typescript
const s3 = await tapNodeTools.createSmarts3();
const s3 = await tapNodeTools.createSmartStorage();
// ... run storage tests ...
await s3.stop();
```
Default config: port 3003, clean slate enabled. Uses [@push.rocks/smarts3](https://code.foss.global/push.rocks/smarts3).
Default config: port 3003, clean slate enabled. Uses [@push.rocks/smartstorage](https://code.foss.global/push.rocks/smartstorage).
---
@@ -244,7 +244,7 @@ test/mytest.all.ts ❌ Will fail in Deno/Bun/Chromium
- [@push.rocks/smartshell](https://code.foss.global/push.rocks/smartshell) — Shell command execution
- [@push.rocks/smartcrypto](https://code.foss.global/push.rocks/smartcrypto) — Certificate generation
- [@push.rocks/smartmongo](https://code.foss.global/push.rocks/smartmongo) — MongoDB testing
- [@push.rocks/smarts3](https://code.foss.global/push.rocks/smarts3) — S3 storage testing
- [@push.rocks/smartstorage](https://code.foss.global/push.rocks/smartstorage) — S3 storage testing
- [@push.rocks/smartfile](https://code.foss.global/push.rocks/smartfile) — File operations
- [@push.rocks/smartrequest](https://code.foss.global/push.rocks/smartrequest) — HTTP requests