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

21 lines
630 B
JavaScript

import { test, expect } from "bun:test";
test("use existing napitests addon", () => {
console.log("Testing existing NAPI addon");
try {
const addon = require("./napi-app/build/Debug/napitests.node");
console.log("Existing addon loaded successfully");
console.log("Available methods:", Object.keys(addon));
// Try calling a simple method if available
if (addon.hello) {
console.log("About to call hello");
const result = addon.hello();
console.log("Result:", result);
}
} catch (error) {
console.log("Error with existing addon:", error.message);
throw error;
}
});