Skip to content

Commit

Permalink
Fix formatting and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
taras committed Jan 22, 2025
1 parent c5e2b76 commit f4730d6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- name: test
run: deno task test

test-node:
runs-on: ubuntu-latest
strategy:
Expand Down
4 changes: 2 additions & 2 deletions tasks/built-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
Expand Down
15 changes: 9 additions & 6 deletions test/main.test.ts
Original file line number Diff line number Diff line change
@@ -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<string, void>, text: string) {
for (const line of yield* each(stream)) {
Expand All @@ -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);
Expand All @@ -34,7 +38,7 @@ describe("main", () => {
const { exitCode, stdout } = yield* proc.kill("SIGTERM");

expect(stdout).toContain("gracefully stopped");

expect(exitCode).toBe(143);
});
});
Expand Down Expand Up @@ -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");
});
});
});

11 changes: 3 additions & 8 deletions test/suite.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -100,7 +95,7 @@ export function x(
*kill(signal) {
tinyexec.kill(signal);
return yield* output;
}
},
};

try {
Expand All @@ -109,4 +104,4 @@ export function x(
yield* tinyproc.kill();
}
});
}
}

0 comments on commit f4730d6

Please sign in to comment.