-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
good first issueGood for newcomersGood for newcomerstype: chorework needed to keep the product and development running smoothlywork needed to keep the product and development running smoothly
Description
We should create integration tests for elf-cam. What we want to test here is if the generated package can be used as promised.
First step run
wasm-pack build --target nodejs
This generates ./pkg
folder with the complete package which we can import in javascript/typescript.
import {} from './pkg/'
If we write the tests in typescript we can also test the generated types easily.
This is the example I used for manual testing:
import { readFileSync } from "fs";
import { detect, Platform } from "./pkg/binary-info.js";
const buffer = readFileSync("./tests/data/nsd_3.0.2_Darwin_arm64");
const x = detect(buffer);
console.log(x);
console.log(x.platform, x.arch, x.runtime);
console.log(x.platform === Platform.Darwin);
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomerstype: chorework needed to keep the product and development running smoothlywork needed to keep the product and development running smoothly