| 22 | } |
| 23 | |
| 24 | async 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 | |
| 44 | module.exports = (async function () { |
| 45 | await beforeAll(addons); |