Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ jobs:
ref: ${{ inputs.ref }}
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
# The stdin regression test spawns Node; exercise the minimum version advertised to users.
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "20.12.0"
- run: bun install --frozen-lockfile

# Every static check reports even when an earlier one fails. Build and tests only run when all pass.
Expand Down Expand Up @@ -90,6 +94,10 @@ jobs:
ref: ${{ inputs.ref }}
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
# The stdin regression test spawns Node; exercise the minimum version advertised to users.
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "20.12.0"
- run: bun install --frozen-lockfile
- run: bun run build
- run: bun pm pack --ignore-scripts
Expand Down
18 changes: 14 additions & 4 deletions src/io/source.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,27 @@ describe("SourceResolver bytes", () => {
child.stdout.on("data", (chunk) => {
output += chunk;
});
child.stderr.on("data", (chunk) => {
errors += chunk;
const ready = new Promise<void>((resolve, reject) => {
child.stderr.on("data", (chunk) => {
errors += chunk;
if (errors.includes("READY\n")) resolve();
});
child.once("close", (code) => {
reject(new Error(`Child exited before READY (${code}):\n${errors}`));
});
child.once("error", (error) => {
reject(error);
});
});

await once(child.stderr, "data");
await ready;
await new Promise((resolve) => setTimeout(resolve, 100));
child.stdin.end("late value");

const [code] = await once(child, "close");
// Node 20 can warn while importing Ink, before the READY marker.
expect(errors).toContain("READY\n");
expect(code).toBe(0);
expect(errors).toBe("READY\n");
expect(output).toBe("late value");
},
);
Expand Down
Loading