Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

Commit

Permalink
Use regexp to match expected report filename
Browse files Browse the repository at this point in the history
  • Loading branch information
richardlau committed Nov 3, 2016
1 parent 14082d2 commit bea2420
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ const REPORT_SECTIONS = [

exports.locate = (pid) => {
// Default NodeReport filenames are of the form NodeReport.<date>.<time>.<pid>.<seq>.txt
const filePattern = new RegExp('^NodeReport\\.\\d+\\.\\d+\\.' + pid + '\\.\\d+\\.txt$');
var files = fs.readdirSync(".");
return files.find((file) => {
return (file.substring(0, 10) == 'NodeReport' && file.indexOf(pid) != -1);
});
return files.find((file) => filePattern.test(file));
};

exports.validate = (t, report, pid) => {
Expand Down

0 comments on commit bea2420

Please sign in to comment.