Skip to content

Commit

Permalink
Removed colors from dist test.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Nov 29, 2023
1 parent 1ea3f49 commit 77e2318
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions tests/dist/test-dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
const util = require('node:util');
const exec = util.promisify(require('node:child_process').exec);

const colorReset = '\x1b[0m';
const colorGreen = '\x1b[32m';
const colorRed = '\x1b[31m';

const features = 'Cipher';

let foundError = false;
Expand All @@ -29,25 +25,21 @@ async function testDistFile(filename) {
const name = filename.substring(5, 8);

if (stdout.trim() === features) {
console.log(`${colorGreen}${name} build passed${colorReset}`);
console.log(`${name} build passed`);
return;
}

foundError = true;

console.error(`${colorRed}${name} build failed:${colorReset}`);
console.error(`${name} build failed:`);
console.error(stderr || `"${stdout.trim()}"\ndoes not match\n"${features}"`);
}

async function testDist() {
console.log('');

await testDistFile('test-ESM.mjs');
await testDistFile('test-CJS.js');

if (foundError) process.exit(1);

console.log('');
}

testDist();

0 comments on commit 77e2318

Please sign in to comment.