Skip to content

Create integration tests #12

Description

@danez

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);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomerstype: chorework needed to keep the product and development running smoothly

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions