docs: rebalance prose cleanup and add trimming skill
This commit is contained in:
@@ -5,10 +5,9 @@ import { fileURLToPath } from 'node:url'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
/**
|
||||
* Built-ARTIFACT smoke for the published package (the real-load-path guard from
|
||||
* docs/testing.md): the unit suite runs `src/` under vitest, where the worker entry resolves
|
||||
* to `src/worker.ts` — a consumer runs `lib/index.js` under plain `node`, where it must
|
||||
* resolve the sibling `lib/worker.js` bundle instead.
|
||||
* Keyless built-artifact smoke: plain Node imports the package by name through its exports map
|
||||
* and exercises type stripping, worker loading, bindings, and logs. It skips when `lib/` is
|
||||
* absent; CI runs it after the build.
|
||||
*/
|
||||
|
||||
const pkgDir = fileURLToPath(new URL('..', import.meta.url))
|
||||
|
||||
@@ -255,8 +255,8 @@ describe('WorkerCodeRuntime — budgets and containment (real workers)', () => {
|
||||
it('captures pipe writes that bypass the patched write slot as stray logs, capped by the same budget', async () => {
|
||||
const { runtime } = await setup({ maxLogBytes: 4 })
|
||||
const result = await runtime.run({
|
||||
// The bootstrap patches the stream instance's own `write`; going through the prototype's
|
||||
// slot reaches the real pipe underneath, so the bytes arrive host-side as stray data.
|
||||
// The prototype write bypasses the patched instance and reaches the real pipe. Pauses keep
|
||||
// writes in separate chunks and let both reach the host before settlement.
|
||||
program: `
|
||||
const write = (text) => Object.getPrototypeOf(process.stdout).write.call(process.stdout, text);
|
||||
write('abcd');
|
||||
|
||||
Reference in New Issue
Block a user