Skip to content

Conversation

@cjraft
Copy link
Contributor

@cjraft cjraft commented Apr 28, 2019

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Apr 28, 2019
@ZYSzys ZYSzys added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Apr 28, 2019
const fn = fixtures.path('empty.txt');

fs.readFile(fn, function(err, data) {
fs.readFile(fn, mustCall(function (err, data) {
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove the space after function:
function (err, data) -> function(err, data)

const assert = require('assert');
const fs = require('fs');
const fixtures = require('../common/fixtures');
const { mustCall } = require('../common')
Copy link
Member

Choose a reason for hiding this comment

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

Hi, missing semicolon here:

Suggested change
const { mustCall } = require('../common')
const { mustCall } = require('../common');

Besides, remember to remove the duplicated require('..common'); in line 23 above if you require('../common') here.

@Trott
Copy link
Member

Trott commented Apr 28, 2019

Nit/note for whoever lands this: Please change adding to imperative form add in the first line of the commit message when landing.

@nodejs-github-bot
Copy link
Collaborator

// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';
require('../common');
Copy link
Member

Choose a reason for hiding this comment

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

The common module should be required in tests before any other module: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#lines-1-3

I’m a little surprised that the linter didn’t pick this up.

Copy link
Member

Choose a reason for hiding this comment

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

Me too... 🤔

Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

common must be required before anything else

@nodejs-github-bot
Copy link
Collaborator

@oyyd
Copy link
Contributor

oyyd commented Apr 30, 2019

Landed in 9c2774e, thanks!

You can visit https://www.nodetodo.org/next-steps/ for more ideas to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants