Skip to content

Commit

Permalink
don't make the module import a test case, fail-fast
Browse files Browse the repository at this point in the history
  • Loading branch information
TTtie committed Nov 10, 2024
1 parent 2372ca1 commit 322db36
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ const EXPECTED_NSECBYTES = 0;

test("native", async (/** @type {import("node:test").TestContext} */ ctx) => {
/** @type {import("./native.js")} */
let mod;

await ctx.test("loads", () => {
mod = require("./native.js");
});
const mod = require("./native.js");

await ctx.test("is really native", () => {
assert.strictEqual(mod.native, true, "module reports itself as non-native");
Expand All @@ -44,12 +40,7 @@ test("native", async (/** @type {import("node:test").TestContext} */ ctx) => {


test("WASM", async (/** @type {import("node:test").TestContext} */ ctx) => {
/** @type {import("./wasm.js")} */
let mod;

await ctx.test("loads", () => {
mod = require("./wasm.js");
});
const mod = require("./wasm.js");

await ctx.test("is really WASM", () => {
assert.strictEqual(mod.wasm, true, "module reports itself as non-WASM");
Expand Down

0 comments on commit 322db36

Please sign in to comment.