Reduce complexity in test262 runner
MODIFY
packages/test262-runner/.eslintrc.json
packages/test262-runner/.eslintrc.json
"es6": true
},
"rules": {
+ "complexity": ["error", 8],
"implicit-arrow-linebreak": "off",
"function-paren-newline": "off",
"arrow-parens": "off",

MODIFY
packages/test262-runner/src/test.js
packages/test262-runner/src/test.js
@@ -17,17 +17,11 @@ export function skipTest(options, testInfo) {
* Create and execute a test using a new module importer. The test
* filemane, esid, and description are displayed in the output.
*/
-export function runTest(options, testInfo) {
+export function runTest(options, testInfo = {}) {
tap.test(testInfo.displayPath, async t => {
// Provide information about the test.
- if (
- typeof testInfo === 'object' &&
- typeof testInfo.description === 'string'
- ) {
- const esid = testInfo.esid || '(no esid)';
- const description = testInfo.description || '(no description)';
+ const { esid = '(no esid)', description = '(no description)' } = testInfo;
t.comment(`${esid}: ${description}`);
- }
const restoreGlobals = captureGlobals(options);
try {

Reduce complexity in test262 runner