Skip to content

Commit

Permalink
use bun test
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 9, 2023
1 parent 1568ed1 commit 3928982
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 28 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"lint": "eslint --ext .ts,.js . && prettier -c src lib test stubs",
"lint:fix": "eslint --fix --ext .ts,.js . && prettier -w src lib test stubs",
"release": "pnpm build && pnpm test && changelogen --release --push && npm publish",
"test": "pnpm lint && vitest run --coverage",
"test:bun": "JITI_DEBUG=1 bun --bun test/bun/index.ts"
"test": "pnpm lint && vitest run --coverage && pnpm test:bun",
"test:bun": "bun --bun test test/bun"
},
"devDependencies": {
"@babel/core": "^7.22.10",
Expand Down
16 changes: 0 additions & 16 deletions test/bun/fixtures.ts

This file was deleted.

21 changes: 21 additions & 0 deletions test/bun/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { fileURLToPath } from "url";
import { readdirSync } from "node:fs";
// @ts-ignore
import { test } from "bun:test";

import jiti from "../../lib/index.js";

const fixturesDir = fileURLToPath(new URL("../fixtures", import.meta.url));

const fixtures = readdirSync(fixturesDir);

const _jiti = jiti(fixturesDir, { debug: true });

for (const fixture of fixtures) {
if (fixture.startsWith("error-")) {
continue;
}
test("fixtures/" + fixture, () => {
_jiti("./" + fixture);
});
}
9 changes: 0 additions & 9 deletions test/bun/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
exclude: ["**/test.{ts,mjs,cjs,js}", "node_modules/**/*"],
exclude: ["**/test.{ts,mjs,cjs,js}", "node_modules/**/*", "test/bun"],
},
});

0 comments on commit 3928982

Please sign in to comment.