From ae6de0c74a288f6d8bc83f45a7a686faf09ba9b1 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sat, 24 Jul 2021 09:13:16 -0700 Subject: [PATCH] [eslint] enable `function-paren-newline`, `function-call-argument-newline` --- .eslintrc | 2 ++ test/skip_explanation.js | 3 +- test/teardown.js | 6 ++-- test/todo_explanation.js | 70 +++++++++++++++++++--------------------- 4 files changed, 42 insertions(+), 39 deletions(-) diff --git a/.eslintrc b/.eslintrc index 88dc68e8..9decf5e4 100644 --- a/.eslintrc +++ b/.eslintrc @@ -14,6 +14,8 @@ "after": true, }], "curly": ["error", "all"], + "function-paren-newline": ["error", "multiline"], + "function-call-argument-newline": ["error", "consistent"], "indent": ["error", 4], "key-spacing": "error", "quotes": ["error", "single", { diff --git a/test/skip_explanation.js b/test/skip_explanation.js index 54c76883..8cdb383e 100644 --- a/test/skip_explanation.js +++ b/test/skip_explanation.js @@ -74,7 +74,8 @@ tap.test('test skip explanations', function (assert) { // var platform = process.platform; something like this needed var platform = 'win32'; - t.fail('run openssl', + t.fail( + 'run openssl', { skip: platform === 'win32' && 'Installer cannot work on windows\nand fails to add to PATH\n\n Err: (2401) denied' } ); t.end(); diff --git a/test/teardown.js b/test/teardown.js index b86da8ed..f8e4c5fc 100644 --- a/test/teardown.js +++ b/test/teardown.js @@ -124,14 +124,16 @@ tap.test('teardowns', function (tt) { ] : [ '# SKIP teardown is only ever called once, even when async', '# SKIP success (promise)' - ], [ + ], + [ '', '1..' + ((typeof Promise === 'function' ? 2 : 0) + 10 + v.nonFunctions.length), '# tests ' + ((typeof Promise === 'function' ? 2 : 0) + 10 + v.nonFunctions.length), '# pass ' + ((typeof Promise === 'function' ? 2 : 0) + 5), '# fail ' + (5 + v.nonFunctions.length), '' - ])); + ] + )); })); test('success', function (t) { diff --git a/test/todo_explanation.js b/test/todo_explanation.js index ce015826..162219f4 100644 --- a/test/todo_explanation.js +++ b/test/todo_explanation.js @@ -12,42 +12,40 @@ tap.test('tape todo test', { todo: process.versions.node.match(/0\.8\.\d+/) ? 'F assert.plan(1); test.createStream().pipe(concat(function (body) { - assert.deepEqual( - stripFullStack(body.toString('utf8')), [ - 'TAP version 13', - '# success', - 'ok 1 this test runs', - '# TODO incomplete test1', - 'not ok 2 check output # TODO', - ' ---', - ' operator: equal', - ' expected: false', - ' actual: true', - ' at: Test. ($TEST/todo_explanation.js:$LINE:$COL)', - ' ...', - 'not ok 3 check vars output # TODO name conflict', - ' ---', - ' operator: equal', - ' expected: 0', - ' actual: 1', - ' at: Test. ($TEST/todo_explanation.js:$LINE:$COL)', - ' ...', - '# incomplete test2', - 'not ok 4 run openssl # TODO installer needs fix', - ' ---', - ' operator: fail', - ' at: Test. ($TEST/todo_explanation.js:$LINE:$COL)', - ' ...', - '# TODO passing test', - '', - '1..4', - '# tests 4', - '# pass 4', - '', - '# ok', - '' - ] - ); + assert.deepEqual(stripFullStack(body.toString('utf8')), [ + 'TAP version 13', + '# success', + 'ok 1 this test runs', + '# TODO incomplete test1', + 'not ok 2 check output # TODO', + ' ---', + ' operator: equal', + ' expected: false', + ' actual: true', + ' at: Test. ($TEST/todo_explanation.js:$LINE:$COL)', + ' ...', + 'not ok 3 check vars output # TODO name conflict', + ' ---', + ' operator: equal', + ' expected: 0', + ' actual: 1', + ' at: Test. ($TEST/todo_explanation.js:$LINE:$COL)', + ' ...', + '# incomplete test2', + 'not ok 4 run openssl # TODO installer needs fix', + ' ---', + ' operator: fail', + ' at: Test. ($TEST/todo_explanation.js:$LINE:$COL)', + ' ...', + '# TODO passing test', + '', + '1..4', + '# tests 4', + '# pass 4', + '', + '# ok', + '' + ]); })); test('success', function (t) {