Skip to content

Commit

Permalink
test: remove unused output argument for getFrames()
Browse files Browse the repository at this point in the history
PR-URL: #28183
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Trott authored and targos committed Jun 18, 2019
1 parent 58eccb1 commit a3f8385
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions test/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,8 @@ Windows and `30` elsewhere.

Returns an array of all `.cpuprofile` files found in `dir`.

### getFrames(output, file, suffix)
### getFrames(file, suffix)

* `output` Unused.
* `file` {string} Path to a `.cpuprofile` file.
* `suffix` {string} Suffix of the URL of call frames to retrieve.
* returns { frames: [&lt;Object>], nodes: [&lt;Object>] }
Expand Down
4 changes: 2 additions & 2 deletions test/common/cpu-prof.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function getCpuProfiles(dir) {
.map((file) => path.join(dir, file));
}

function getFrames(output, file, suffix) {
function getFrames(file, suffix) {
const data = fs.readFileSync(file, 'utf8');
const profile = JSON.parse(data);
const frames = profile.nodes.filter((i) => {
Expand All @@ -25,7 +25,7 @@ function getFrames(output, file, suffix) {
}

function verifyFrames(output, file, suffix) {
const { frames, nodes } = getFrames(output, file, suffix);
const { frames, nodes } = getFrames(file, suffix);
if (frames.length === 0) {
// Show native debug output and the profile for debugging.
console.log(output.stderr.toString());
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-cpu-prof-dir-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ const {
assert(fs.existsSync(dir));
const profiles = getCpuProfiles(dir);
assert.strictEqual(profiles.length, 2);
const profile1 = getFrames(output, profiles[0], 'fibonacci.js');
const profile2 = getFrames(output, profiles[1], 'fibonacci.js');
const profile1 = getFrames(profiles[0], 'fibonacci.js');
const profile2 = getFrames(profiles[1], 'fibonacci.js');
if (profile1.frames.length === 0 && profile2.frames.length === 0) {
// Show native debug output and the profile for debugging.
console.log(output.stderr.toString());
Expand Down

0 comments on commit a3f8385

Please sign in to comment.