MCPcopy Create free account
hub / github.com/nodejs/node-addon-api / test

Function test

test/addon_build/index.js:24–42  ·  view source on GitHub ↗
(addon)

Source from the content-addressed store, hash-verified

22}
23
24async function test (addon) {
25 console.log(` >Building addon: '${addon}'`);
26 await exec('npm install', {
27 cwd: path.join(ADDONS_FOLDER, addon)
28 });
29 console.log(` >Running test for: '${addon}'`);
30 // Disabled the checks on stderr and stdout because of this issue on npm:
31 // Stop using process.umask(): https://github.com/npm/cli/issues/1103
32 // We should enable the following checks again after the resolution of
33 // the reported issue.
34 // assert.strictEqual(stderr, '');
35 // assert.ok(stderr.length === 0);
36 // assert.ok(stdout.length > 0);
37 const binding = require(`${ADDONS_FOLDER}/${addon}`);
38 assert.strictEqual(binding.except.echo('except'), 'except');
39 assert.strictEqual(binding.except.echo(101), 101);
40 assert.strictEqual(binding.noexcept.echo('noexcept'), 'noexcept');
41 assert.strictEqual(binding.noexcept.echo(103), 103);
42}
43
44module.exports = (async function () {
45 await beforeAll(addons);

Callers 1

index.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected