diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml index 10d86aa5..e9c8c512 100644 --- a/.github/workflows/verify.yaml +++ b/.github/workflows/verify.yaml @@ -30,7 +30,7 @@ jobs: - name: test run: deno task test - + test-node: runs-on: ubuntu-latest strategy: diff --git a/tasks/built-test.ts b/tasks/built-test.ts index cd6b8f58..40d08e61 100644 --- a/tasks/built-test.ts +++ b/tasks/built-test.ts @@ -5,9 +5,9 @@ const outDir = "./build/test"; await emptyDir(outDir); const entryPoints = [ - "./lib/mod.ts" + "./lib/mod.ts", ]; -for await (const entry of Deno.readDir('test')) { +for await (const entry of Deno.readDir("test")) { if (entry.isFile) { entryPoints.push(`./test/${entry.name}`); } diff --git a/test/main.test.ts b/test/main.test.ts index cce4ac21..fb660713 100644 --- a/test/main.test.ts +++ b/test/main.test.ts @@ -1,5 +1,9 @@ -import { $await, describe, expect, it, x } from "./suite.ts"; -import { each, type Operation, resource, run, sleep, spawn, type Stream } from "../mod.ts"; +import { describe, expect, it, x } from "./suite.ts"; +import { + each, + run, + type Stream, +} from "../mod.ts"; function* until(stream: Stream, text: string) { for (const line of yield* each(stream)) { @@ -18,7 +22,7 @@ describe("main", () => { yield* until(proc.lines, "started"); const { exitCode, stdout } = yield* proc.kill("SIGINT"); - + expect(stdout).toContain("gracefully stopped"); expect(exitCode).toBe(130); @@ -34,7 +38,7 @@ describe("main", () => { const { exitCode, stdout } = yield* proc.kill("SIGTERM"); expect(stdout).toContain("gracefully stopped"); - + expect(exitCode).toBe(143); }); }); @@ -91,10 +95,9 @@ describe("main", () => { yield* until(proc.lines, "started"); const { exitCode, stdout } = yield* proc.kill("SIGINT"); - + expect(exitCode).toBe(130); expect(stdout).toContain("gracefully stopped"); }); }); }); - diff --git a/test/suite.ts b/test/suite.ts index ef75fe7b..ef1d87a4 100644 --- a/test/suite.ts +++ b/test/suite.ts @@ -1,12 +1,7 @@ export { expect } from "@std/expect"; export { afterEach, beforeEach, describe, it } from "@std/testing/bdd"; export { expectType } from "ts-expect"; -import { - type KillSignal, - type Options, - type Output, - x as $x, -} from "tinyexec"; +import { type KillSignal, type Options, type Output, x as $x } from "tinyexec"; import type { Operation, Stream } from "../lib/types.ts"; import { call, resource, sleep, spawn, stream } from "../mod.ts"; @@ -100,7 +95,7 @@ export function x( *kill(signal) { tinyexec.kill(signal); return yield* output; - } + }, }; try { @@ -109,4 +104,4 @@ export function x( yield* tinyproc.kill(); } }); -} \ No newline at end of file +}