Files
bun.sh/test/napi/simple-function-test.test.js
Claude Bot f3fb7e5c48 wip
2025-08-11 20:12:52 +00:00

18 lines
615 B
JavaScript

import { test, expect } from "bun:test";
import { join } from "path";
test("call simple NAPI function without exceptions", () => {
console.log("Testing simple NAPI function");
const addonPath = join(import.meta.dir, "napi-app", "build", "Debug", "simple_test_addon.node");
const addon = require(addonPath);
console.log("Available methods:", Object.keys(addon));
// Call the simple function that doesn't throw
console.log("About to call testSimpleReturn");
const result = addon.testSimpleReturn();
console.log("Result:", result);
expect(result).toBe("Hello from simple function!");
});