Skip to content

Commit

Permalink
tests ~ refactor 'integration.test.js' (improved clarity/DRY and poli…
Browse files Browse the repository at this point in the history
…sh commentary)
  • Loading branch information
rivy committed Jul 31, 2022
1 parent d221660 commit 9750653
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const test = require('ava');
const commandExists = require('command-exists');
const spawn = require('cross-spawn');

const module_ = require('../build/testbed/src/mod.cjs.js');
const modulePath = '../build/testbed/src/mod.cjs.js';
// eslint-disable-next-line security/detect-non-literal-require , security-node/detect-non-literal-require-calls
const module_ = require(modulePath);

const vNodeJS = process.versions.node.split('.');
const vNodeJSMajor = +vNodeJS[0];
Expand All @@ -37,9 +39,9 @@ test('api', (t) => {
});
});

// test examples with version changes or distribution
// test examples when using `--test-dist` (ie, with version changes or prior to distribution)
if (!process.env.npm_config_test_dist) {
test('skipped example testing (enable with `--test-dist`)', (t) => t.pass());
test('examples are executable...skipped (enable with `npm test --test-dist`)', (t) => t.pass());
} else {
if (!commandExists.sync('deno')) {
test.skip('`deno` not found; Deno examples not tested', (t) => {
Expand Down

0 comments on commit 9750653

Please sign in to comment.