diff --git a/.gitignore b/.gitignore index 1767441..14639fa 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,4 @@ node-report*.txt npm-debug.log nodereport-*.tgz nodereport_test.log +package-lock.json diff --git a/.taprc b/.taprc new file mode 100644 index 0000000..13df826 --- /dev/null +++ b/.taprc @@ -0,0 +1 @@ +esm: false diff --git a/package.json b/package.json index d07942e..7e68e29 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,6 @@ "url": "https://github.com/nodejs/node-report/issues" }, "devDependencies": { - "tap": "~12.4.1" + "tap": "^14.3.1" } } diff --git a/test/test-api-getreport.js b/test/test-api-getreport.js index a757727..eacf7cd 100644 --- a/test/test-api-getreport.js +++ b/test/test-api-getreport.js @@ -17,6 +17,12 @@ if (process.argv[2] === 'child') { 'Checking no messages on stderr'); const reportFiles = common.findReports(child.pid); tap.same(reportFiles, [], 'Checking no report files were written'); + + // tap with coverage enabled wraps the child so adjust expected command line + if (process.env['SPAWN_WRAP_SHIM_ROOT']) { + args.unshift('.*node'); + } + tap.test('Validating report content', (t) => { common.validateContent(child.stdout, t, { pid: child.pid, commandline: process.execPath + ' ' + args.join(' ') diff --git a/test/test-fatal-error.js b/test/test-fatal-error.js index b373c71..416af1b 100644 --- a/test/test-fatal-error.js +++ b/test/test-fatal-error.js @@ -5,6 +5,10 @@ if (process.argv[2] === 'child') { require('../'); const list = []; + // tap with coverage enabled installs signal handlers that prevents the + // fatal error causing the process to exit. Remove them. + process.removeAllListeners('SIGABRT'); + process.removeAllListeners('SIGTRAP'); while (true) { const record = new MyRecord(); list.push(record); diff --git a/test/test-signal.js b/test/test-signal.js index 5db02f6..1f71675 100644 --- a/test/test-signal.js +++ b/test/test-signal.js @@ -8,6 +8,10 @@ if (process.argv[2] === 'child') { // Exit on loss of parent process process.on('disconnect', () => process.exit(2)); + // tap with coverage enabled installs signal handlers that prevents the + // signal from causing the process to exit. Remove them. + process.removeAllListeners('SIGTERM'); + function busyLoop() { var list = []; for (var i = 0; i < 1e10; i++) {