Skip to content
Prev Previous commit
Next Next commit
test: change test-fs-existssync-false.js
Change test-fs-existssync-false.js to make sure it conforms to
the standard test structure.

Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure
  • Loading branch information
ryzokuken committed Mar 8, 2018
commit 3dd96889ce67fe9462bf9245d8de89c33bbbcf68
3 changes: 1 addition & 2 deletions test/parallel/test-fs-existssync-false.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';
const common = require('../common');
const tmpdir = require('../common/tmpdir');

// This test ensures that fs.existsSync doesn't incorrectly return false
// (especially on Windows)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: It would be nice to punctuate the new comments.

Expand All @@ -9,8 +10,6 @@ const assert = require('assert');
const fs = require('fs');
const path = require('path');

const tmpdir = require('../common/tmpdir');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I personally would not mode this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that in conflict with the canonical test structure?

Ref: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#lines-1-3

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is specific to the require('../common'); but it is fine to keep it as is.

let dir = path.resolve(tmpdir.path);

// Make sure that the tmp directory is clean
Expand Down