Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create integration tests #12

Open
danez opened this issue Jun 23, 2022 · 0 comments
Open

Create integration tests #12

danez opened this issue Jun 23, 2022 · 0 comments
Labels
good first issue Good for newcomers type: chore work needed to keep the product and development running smoothly

Comments

@danez
Copy link
Contributor

danez commented Jun 23, 2022

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);
@danez danez added good first issue Good for newcomers type: chore work needed to keep the product and development running smoothly labels Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type: chore work needed to keep the product and development running smoothly
Projects
None yet
Development

No branches or pull requests

1 participant