Skip to content

Commit a83bbaa

Browse files
TrottMylesBorins
authored andcommitted
test: refactor test-tick-processor
The test does some extra work that isn't necessary because of the way temp directories are handled. The test removes all files from the temp directory with `common.refreshTmpDir()` but still filters the results even though only its files will be in the directory). Refactor to remove that unneeded logic. PR-URL: #8180 Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 1c81c07 commit a83bbaa

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

test/parallel/test-tick-processor.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,10 @@ runTest(/RunInDebugContext/,
4545

4646
function runTest(pattern, code) {
4747
cp.execFileSync(process.execPath, ['-prof', '-pe', code]);
48-
var matches = fs.readdirSync(common.tmpDir).filter(function(file) {
49-
return /^isolate-/.test(file);
50-
});
51-
if (matches.length != 1) {
52-
common.fail('There should be a single log file.');
53-
}
48+
var matches = fs.readdirSync(common.tmpDir);
49+
50+
assert.strictEqual(matches.length, 1, 'There should be a single log file.');
51+
5452
var log = matches[0];
5553
var out = cp.execSync(process.execPath +
5654
' --prof-process --call-graph-size=10 ' + log,

0 commit comments

Comments
 (0)