diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 944438dc..ec1323a9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,8 +54,7 @@ jobs: with: bun-version: latest - run: bun install - - run: bun cli/bun.ts - - run: bun test bun --coverage --coverage-reporter=lcov + - run: bun test src --coverage --coverage-reporter=lcov - uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/cli/bun.ts b/cli/bun.ts deleted file mode 100644 index e79f6a59..00000000 --- a/cli/bun.ts +++ /dev/null @@ -1,41 +0,0 @@ -import * as fs from "node:fs/promises"; -import { URL } from "node:url"; -import ts from "typescript"; -import { listFiles, listTsSourceStringLiterals } from "./util.ts"; - -const srcDir = new URL("../src/", import.meta.url); -const bunDir = new URL("../bun/", import.meta.url); - -await fs.mkdir(bunDir, { recursive: true }); - -for await (const fileUrl of listFiles(bunDir)) { - await fs.unlink(fileUrl); -} - -for await (const fileUrl of listFiles(srcDir)) { - const filePath = fileUrl.pathname.slice(srcDir.pathname.length); - if (filePath.endsWith(".ts")) { - let code = await fs.readFile(fileUrl, "utf-8"); - const tsSource = ts.createSourceFile( - filePath, - code, - ts.ScriptTarget.ESNext, - ); - const replaceList: Array = []; - for (const node of listTsSourceStringLiterals(tsSource)) { - const importFromText = node.text; - if (importFromText === "node:test") { - replaceList.push(node); - } - } - replaceList.sort((n1, n2) => n2.getFullStart() - n1.getFullStart()); - for (const node of replaceList) { - const start = code.indexOf(node.text, node.getFullStart()); - const end = start + node.text.length; - code = `${code.slice(0, start)}bun:test${code.slice(end)}`; - } - const destUrl = new URL(filePath, bunDir); - await fs.mkdir(new URL(".", destUrl), { recursive: true }); - await fs.writeFile(destUrl, code); - } -} diff --git a/package.json b/package.json index ae33af78..ff634e60 100644 --- a/package.json +++ b/package.json @@ -32,10 +32,6 @@ "test:type": "tsc", "test:unit": "node --test \"src/**/*.test.ts\"", "test:example": "node --test example.test.ts", - "test-bun": "run-s test-bun:*", - "test-bun:setup": "bun cli/bun.ts", - "test-bun:test": "bun test bun", - "test-deno": "deno test --allow-read src", "lint": "biome check", "build": "run-s build:*", "build:index": "node cli/generate-index.ts",