Skip to content

Commit a5052ab

Browse files
author
Gabriel Schulhof
committed
heed review comments
1 parent c67bd33 commit a5052ab

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

test/node_modules/duplicate_symbols/common.h

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/node_modules/duplicate_symbols/package.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/test-addon.js

+4-8
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ function runHello(hostProcess) {
1919
return execFileSync(hostProcess, ['-e', testCode], { cwd: __dirname }).toString()
2020
}
2121

22-
function runDuplicateBindings(hostProcess) {
23-
if (!hostProcess) {
24-
hostProcess = process.execPath
25-
}
22+
function runDuplicateBindings() {
23+
const hostProcess = process.execPath;
2624
var testCode =
2725
"console.log((function(bindings) {" +
2826
"return bindings.pointerCheck1(bindings.pointerCheck2());" +
@@ -70,15 +68,13 @@ test('make sure addon symbols do not overlap', function (t) {
7068
var addonPath = path.resolve(__dirname, 'node_modules', 'duplicate_symbols')
7169
// Set the loglevel otherwise the output disappears when run via 'npm test'
7270
var cmd = [nodeGyp, 'rebuild', '-C', addonPath, '--loglevel=verbose']
73-
var proc = execFile(process.execPath, cmd, function (err, stdout, stderr) {
74-
var logLines = stderr.toString().trim().split(/\r?\n/)
71+
execFile(process.execPath, cmd, function (err, stdout, stderr) {
72+
var logLines = stderr.trim().split(/\r?\n/)
7573
var lastLine = logLines[logLines.length-1]
7674
t.strictEqual(err, null)
7775
t.strictEqual(lastLine, 'gyp info ok', 'should end in ok')
7876
t.strictEqual(runDuplicateBindings().trim(), 'not equal')
7977
})
80-
proc.stdout.setEncoding('utf-8')
81-
proc.stderr.setEncoding('utf-8')
8278
})
8379

8480
test('build simple addon in path with non-ascii characters', function (t) {

0 commit comments

Comments
 (0)