wallabyjs / public

Repository for Wallaby.js questions and issues
http://wallabyjs.com
760 stars 45 forks source link

Usage of fetch API in node fails the first test with fetch usage. Subsequent tests are passing in wallaby. #3012

Closed bhvngt closed 2 years ago

bhvngt commented 2 years ago

Issue description or question

I have been using fetch api using node 18.2.0. Recently, I have been facing this weird issue. Where the very first test in a test file where fetch API is getting called is failed by wallabyjs. Subsequent tests gets passed by the tool. Here's screenshot with the reproduction.

Here's the link to the repo that sort of mimics my project structure and where I could reproduce this issue.

image

Wallaby diagnostics report

{
  editorVersion: 'IntelliJ IDEA 2022.1.2',
  pluginVersion: '1.0.239',
  editorType: 'IntelliJ',
  osVersion: 'darwin 21.5.0',
  nodeVersion: 'v18.2.0',
  coreVersion: '1.0.1286',
  checksum: 'MmUxNzQ4YTIxNGUwZjZhODg5YWRhNzc5Y2E0OWY3MzgsMTY2OTU5MzYwMDAwMCww',
  config: {
    files: [
      { pattern: 'package.json', instrument: false, ignore: false, trigger: true, load: true, order: 1 },
      { pattern: 'libs/{domain,store}/{src,test,types}/**/!(*.+(test|spec)).{js,ts,json}', ignore: false, trigger: true, load: true, instrument: true, order: 2 },
      { pattern: '**/node_modules/**', instrument: false, ignore: true, trigger: true, load: true },
      { pattern: '.env', instrument: false, ignore: false, trigger: true, load: true, order: 3 }
    ],
    tests: [
      { pattern: 'libs/{service,domain,store}/test/**/*.+(test|spec).ts', ignore: false, trigger: true, load: true, test: true, order: 4 },
      { pattern: '**/node_modules/**', ignore: true, trigger: true, load: true, test: true }
    ],
    testFramework: { version: 'mocha@2.1.0', configurator: 'mocha@2.1.0', reporter: 'mocha@2.1.0', starter: 'mocha@2.1.0' },
    filesWithNoCoverageCalculated: [ '**/node_modules/**', '**/test/**/*' ],
    env: {
      type: 'node',
      params: { runner: '--experimental-specifier-resolution=node --experimental-json-modules --experimental-loader <homeDir>/Projects/lab/temp/wallaby-mocha-rushjs/loader.js' },
      DOTENV_CONFIG_PATH: '.env',
      runner: '<homeDir>/Library/Application Support/fnm/node-versions/v18.2.0/installation/bin/node',
      viewportSize: { width: 800, height: 600 },
      options: { width: 800, height: 600 },
      bundle: true
    },
    workers: { restart: true, initial: 0, regular: 0, recycle: true },
    debug: true,
    reportConsoleErrorAsError: true,
    diagnostics: {},
    runAllTestsInAffectedTestFile: false,
    updateNoMoreThanOneSnapshotPerTestFileRun: false,
    compilers: { '**/*.?(lit)coffee?(.md)': [Function (anonymous)] },
    logLimits: { inline: { depth: 5, elements: 5000 }, values: { default: { stringLength: 200 }, autoExpand: { elements: 5000, stringLength: 8192, depth: 10 } } },
    preprocessors: {},
    maxConsoleMessagesPerTest: 100,
    autoConsoleLog: true,
    delays: { run: 0, edit: 100, update: 0 },
    teardown: undefined,
    hints: {
      ignoreCoverage: '__REGEXP /ignore coverage|istanbul ignore/',
      ignoreCoverageForFile: '__REGEXP /ignore file coverage/',
      commentAutoLog: '?',
      testFileSelection: { include: '__REGEXP /file\\.only/', exclude: '__REGEXP /file\\.skip/' }
    },
    automaticTestFileSelection: true,
    runSelectedTestsOnly: false,
    mapConsoleMessagesStackTrace: false,
    extensions: {},
    reportUnhandledPromises: true,
    slowTestThreshold: 75,
    lowCoverageThreshold: 80,
    loose: undefined,
    symlinkNodeModules: true,
    configCode: 'const fs = require("fs");\n' +
      'const path = require("path");\n' +
      'module.exports = async function(wallaby) {\n' +
      '\treturn {\n' +
      '\t\tfiles: [\n' +
      '\t\t\t{ pattern: "package.json", instrument: false },\n' +
      '\t\t\t"libs/{domain,store}/{src,test,types}/**/!(*.+(test|spec)).{js,ts,json}",\n' +
      '\t\t\t{ pattern: "!**/node_modules/**", instrument: false },\n' +
      '\t\t\t{ pattern: ".env", instrument: false }\n' +
      '\t\t],\n' +
      '\n' +
      '\t\ttests: [\n' +
      '\t\t\t"libs/{service,domain,store}/test/**/*.+(test|spec).ts",\n' +
      '\t\t\t"!**/node_modules/**"\n' +
      '\t\t],\n' +
      '\n' +
      '\t\ttestFramework: "mocha",\n' +
      '\t\tfilesWithNoCoverageCalculated: ["**/node_modules/**", "**/test/**/*"],\n' +
      '\n' +
      '\t\tenv: {\n' +
      '\t\t\ttype: "node",\n' +
      '\t\t\tparams: {\n' +
      `\t\t\t\trunner: "--experimental-specifier-resolution=node --experimental-json-modules --experimental-loader " + require('path').join(__dirname, 'loader.js')\n` +
      '\t\t\t},\n' +
      '\t\t\t"DOTENV_CONFIG_PATH": ".env"\n' +
      '\t\t},\n' +
      '\n' +
      '\t\tworkers: { restart: true },\n' +
      '\t\tdebug: true,\n' +
      '\t\treportConsoleErrorAsError: true,\n' +
      '\t\tsetup: async (wallaby) => {\n' +
      "\t\t\tprocess.env.projectCacheDir = 'file://' + wallaby.projectCacheDir;\n" +
      "\t\t\tprocess.env.localProjectDir = 'file://' + wallaby.localProjectDir;\n" +
      '\n' +
      '\t\t\tconst fs = require("fs");\n' +
      '\t\t\tconst path = require("path");\n' +
      '\t\t\trequire("dotenv-expand").expand(require("dotenv").config());\n' +
      '\n' +
      '\t\t\tif (!process.env.INITIALIZED) {\n' +
      '\t\t\t\tawait setupChai();\n' +
      '\t\t\t\tprocess.env.INITIALIZED = "true";\n' +
      '\t\t\t}\n' +
      '\n' +
      '\t\t\tfunction rushJson() {\n' +
      '\t\t\t\tconst json5 = require("json5");\n' +
      '\t\t\t\treturn json5.parse(fs.readFileSync(path.join(wallaby.localProjectDir, "rush.json"), "utf-8"));\n' +
      '\t\t\t}\n' +
      '\n' +
      '\t\t\tasync function setupChai() {\n' +
      '\t\t\t\tconst chai = require("chai");\n' +
      '\t\t\t\tchai.should();\n' +
      '\t\t\t\tconst projectPaths = rushJson().projects.map(p => path.join(wallaby.localProjectDir, p.projectFolder))\n' +
      '\t\t\t\tawait Promise.all(projectPaths.map(async (path) => {\n' +
      '\t\t\t\t\tconst globalSetupFile = `${path}/test/helpers/globalSetup.js`;\n' +
      '\t\t\t\t\tif (fs.existsSync(globalSetupFile)) {\n' +
      '\t\t\t\t\t\tconst globalSetup = await import(globalSetupFile);\n' +
      '\t\t\t\t\t\tglobalSetup.mochaGlobalSetup?.();\n' +
      '\t\t\t\t\t}\n' +
      '\t\t\t\t\tconst rootHooksFile = `${path}/test/helpers/rootHooks.js`;\n' +
      '\t\t\t\t\tif (fs.existsSync(rootHooksFile)) {\n' +
      '\t\t\t\t\t\tconsole.log(`rootHooksFile`, rootHooksFile);\n' +
      '\t\t\t\t\t\tconst mocha = wallaby.testFramework;\n' +
      '\t\t\t\t\t\tconst rootHook = await import(rootHooksFile);\n' +
      '\t\t\t\t\t\tmocha.rootHooks(rootHook.mochaHooks);\n' +
      '\t\t\t\t\t}\n' +
      '\t\t\t\t}));\n' +
      '\t\t\t}\n' +
      '\t\t}\n' +
      '\t};\n' +
      '};'
  },
  packageJSON: { dependencies: undefined, devDependencies: undefined },
  fs: { numberOfFiles: 13 },
  debug: [
    '2022-06-15T17:29:25.874Z project Wallaby Node version: v18.2.0\n',
    '2022-06-15T17:29:25.874Z project Wallaby config: <homeDir>/Projects/lab/temp/wallaby-mocha-rushjs/wallaby.cjs\n',
    '2022-06-15T17:29:28.093Z project File cache: <homeDir>/Library/Caches/JetBrains/IntelliJIdea2022.1/wallaby/projects/bafc736c9820b9c4\n',
    '2022-06-15T17:29:28.095Z uiService Listening port 51236\n',
    '2022-06-15T17:29:28.098Z workers Parallelism for initial run: 8, for regular run: 4\n',
    '2022-06-15T17:29:28.099Z workers Starting run worker instance #0\n',
    '2022-06-15T17:29:28.099Z workers Starting run worker instance #1\n',
    '2022-06-15T17:29:28.099Z workers Starting run worker instance #2\n',
    '2022-06-15T17:29:28.099Z workers Starting run worker instance #3\n',
    '2022-06-15T17:29:28.099Z workers Starting run worker instance #4\n',
    '2022-06-15T17:29:28.099Z workers Starting run worker instance #5\n',
    '2022-06-15T17:29:28.099Z workers Starting run worker instance #6\n',
    '2022-06-15T17:29:28.099Z workers Starting run worker instance #7\n',
    '2022-06-15T17:29:28.099Z workers Web server is listening at 52784\n',
    '2022-06-15T17:29:28.123Z project File cache requires some updates, waiting required files from IDE\n',
    '2022-06-15T17:29:28.718Z project Stopping process pool\n',
    '2022-06-15T17:29:28.727Z project Running postprocessor\n',
    '2022-06-15T17:29:28.728Z postprocessor New TypeScript language service is required\n',
    '2022-06-15T17:29:28.877Z project Postprocessor execution finished\n',
    '2022-06-15T17:29:28.877Z project Test run started; run priority: 3\n',
    '2022-06-15T17:29:28.877Z project Running all tests\n',
    '2022-06-15T17:29:28.878Z workers Starting test run, priority: 3\n',
    '2022-06-15T17:29:28.878Z workers Distributing tests between 8 workers\n',
    '2022-06-15T17:29:28.878Z workers Running tests in parallel\n',
    '2022-06-15T17:29:28.878Z nodeRunner Starting sandbox [worker #0, session #xt0u7]\n',
    '2022-06-15T17:29:28.878Z nodeRunner Starting sandbox [worker #1, session #ug64x]\n',
    '2022-06-15T17:29:28.878Z nodeRunner Starting sandbox [worker #2, session #njxyk]\n',
    '2022-06-15T17:29:28.878Z nodeRunner Starting sandbox [worker #3, session #ppby5]\n',
    '2022-06-15T17:29:28.878Z nodeRunner Preparing sandbox [worker #0, session #xt0u7]\n',
    '2022-06-15T17:29:28.879Z nodeRunner Preparing sandbox [worker #1, session #ug64x]\n',
    '2022-06-15T17:29:28.879Z nodeRunner Preparing sandbox [worker #2, session #njxyk]\n',
    '2022-06-15T17:29:28.879Z nodeRunner Preparing sandbox [worker #3, session #ppby5]\n',
    '2022-06-15T17:29:28.880Z workers Started run worker instance (delayed) #3\n',
    '2022-06-15T17:29:28.880Z nodeRunner Prepared sandbox [worker #3, session #ppby5]\n',
    '2022-06-15T17:29:28.880Z workers [worker #3, session #ppby5] Running tests in sandbox\n',
    '2022-06-15T17:29:28.881Z workers Started run worker instance (delayed) #0\n',
    '2022-06-15T17:29:28.881Z nodeRunner Prepared sandbox [worker #0, session #xt0u7]\n',
    '2022-06-15T17:29:28.881Z workers [worker #0, session #xt0u7] Running tests in sandbox\n',
    '2022-06-15T17:29:28.881Z workers Started run worker instance (delayed) #1\n',
    '2022-06-15T17:29:28.881Z nodeRunner Prepared sandbox [worker #1, session #ug64x]\n',
    '2022-06-15T17:29:28.881Z workers [worker #1, session #ug64x] Running tests in sandbox\n',
    '2022-06-15T17:29:28.881Z workers Started run worker instance (delayed) #4\n',
    '2022-06-15T17:29:28.881Z workers Started run worker instance (delayed) #2\n',
    '2022-06-15T17:29:28.881Z nodeRunner Prepared sandbox [worker #2, session #njxyk]\n',
    '2022-06-15T17:29:28.881Z workers [worker #2, session #njxyk] Running tests in sandbox\n',
    '2022-06-15T17:29:28.881Z workers Started run worker instance (delayed) #6\n',
    '2022-06-15T17:29:28.881Z workers Started run worker instance (delayed) #7\n',
    '2022-06-15T17:29:28.881Z workers Started run worker instance (delayed) #5\n',
    '2022-06-15T17:29:28.952Z workers [ug64x] Loaded 1 test(s)\n',
    '2022-06-15T17:29:28.952Z workers [xt0u7] Loaded 1 test(s)\n',
    '2022-06-15T17:29:28.953Z workers [ug64x] Test executed: should pass valid operations\n',
    '2022-06-15T17:29:28.953Z workers [ppby5] Loaded 2 test(s)\n',
    '2022-06-15T17:29:28.953Z workers [njxyk] Loaded 1 test(s)\n',
    '2022-06-15T17:29:28.955Z workers [ug64x] Run 1 test(s), skipped 0 test(s)\n',
    '2022-06-15T17:29:28.955Z workers [xt0u7] Test executed: should pass valid operations\n',
    '2022-06-15T17:29:28.956Z workers [ug64x] Sandbox is responsive, closing it\n',
    '2022-06-15T17:29:28.956Z workers Recyling run worker instance #1\n',
    '2022-06-15T17:29:28.956Z workers Starting run worker instance #1\n',
    '2022-06-15T17:29:28.963Z workers [xt0u7] Run 1 test(s), skipped 0 test(s)\n',
    '2022-06-15T17:29:28.964Z workers [xt0u7] Sandbox is responsive, closing it\n',
    '2022-06-15T17:29:28.964Z workers Recyling run worker instance #0\n',
    '2022-06-15T17:29:28.964Z workers Starting run worker instance #0\n',
    '2022-06-15T17:29:28.994Z workers [njxyk] Test executed: should pass valid operations\n',
    '2022-06-15T17:29:28.999Z workers [njxyk] Run 1 test(s), skipped 0 test(s)\n',
    '2022-06-15T17:29:28.999Z workers [njxyk] Sandbox is responsive, closing it\n',
    '2022-06-15T17:29:28.999Z workers Recyling run worker instance #2\n',
    '2022-06-15T17:29:28.999Z workers Starting run worker instance #2\n',
    '2022-06-15T17:29:29.330Z workers Started run worker instance (delayed) #0\n',
    '2022-06-15T17:29:29.331Z workers Started run worker instance (delayed) #1\n',
    '2022-06-15T17:29:29.369Z workers Started run worker instance (delayed) #2\n',
    '2022-06-15T17:29:29.515Z workers [ppby5] Test executed: should pass valid operations\n',
    '2022-06-15T17:29:29.689Z workers [ppby5] Test executed: should pass valid operations\n',
    '2022-06-15T17:29:29.692Z workers [ppby5] Run 2 test(s), skipped 0 test(s)\n',
    '2022-06-15T17:29:29.694Z workers [ppby5] Sandbox is responsive, closing it\n',
    '2022-06-15T17:29:29.694Z workers Recyling run worker instance #3\n',
    '2022-06-15T17:29:29.694Z workers Starting run worker instance #3\n',
    '2022-06-15T17:29:29.694Z workers Merging parallel test run results\n',
    '2022-06-15T17:29:29.695Z project Test run finished\n',
    '2022-06-15T17:29:29.695Z project Processed console.log entries\n',
    '2022-06-15T17:29:29.695Z project Processed loading sequences\n',
    '2022-06-15T17:29:29.696Z project Test name duplicate: should pass valid operations\n',
    '2022-06-15T17:29:29.696Z project Processed executed tests\n',
    '2022-06-15T17:29:29.697Z project Processed code coverage\n',
    '2022-06-15T17:29:29.708Z project Test run result processed and sent to IDE\n',
    '2022-06-15T17:29:30.084Z workers Started run worker instance (delayed) #3\n',
    '2022-06-15T17:29:39.079Z fs File changed: libs/store/test/utils/Bar.test.ts\n',
    '2022-06-15T17:29:39.087Z project Running postprocessor\n',
    '2022-06-15T17:29:39.087Z testTask Test files from affected: 1, from deleted or manually requested: 0, from recently changed: 0, from loaded by: 0, from failing: 0\n',
    '2022-06-15T17:29:39.104Z project Postprocessor execution finished\n',
    '2022-06-15T17:29:39.105Z project Test run started; run priority: 2\n',
    '2022-06-15T17:29:39.105Z testTask Test files from affected: 1, from deleted or manually requested: 0, from recently changed: 0, from loaded by: 0, from failing: 0\n',
    '2022-06-15T17:29:39.105Z workers Starting test run, priority: 2\n',
    '2022-06-15T17:29:39.105Z nodeRunner Starting sandbox [worker #0, session #kc8o0]\n',
    '2022-06-15T17:29:39.105Z nodeRunner Preparing sandbox [worker #0, session #kc8o0]\n',
    '2022-06-15T17:29:39.105Z nodeRunner Prepared sandbox [worker #0, session #kc8o0]\n',
    '2022-06-15T17:29:39.105Z workers [worker #0, session #kc8o0] Running tests in sandbox\n',
    '2022-06-15T17:29:39.172Z workers [kc8o0] Loaded 2 test(s)\n',
    '2022-06-15T17:29:39.472Z fs File changed in editor: libs/store/test/utils/Bar.test.ts\n',
    '2022-06-15T17:29:39.472Z fs No changes detected for libs/store/test/utils/Bar.test.ts\n',
    '2022-06-15T17:29:39.773Z workers [kc8o0] Test executed: should pass valid operations\n',
    '2022-06-15T17:29:39.970Z workers [kc8o0] Test executed: should pass valid operations\n',
    '2022-06-15T17:29:39.971Z workers [kc8o0] Run 2 test(s), skipped 0 test(s)\n',
    '2022-06-15T17:29:39.972Z workers [kc8o0] Sandbox is responsive, closing it\n',
    '2022-06-15T17:29:39.972Z workers Recyling run worker instance #0\n',
    '2022-06-15T17:29:39.972Z workers Starting run worker instance #0\n',
    '2022-06-15T17:29:39.972Z project Test run finished\n',
    '2022-06-15T17:29:39.972Z project Processed console.log entries\n',
    '2022-06-15T17:29:39.973Z project Processed loading sequences\n',
    '2022-06-15T17:29:39.973Z project Test name duplicate: should pass valid operations\n',
    '2022-06-15T17:29:39.973Z project Processed executed tests\n',
    '2022-06-15T17:29:39.973Z project Processed code coverage\n',
    '2022-06-15T17:29:39.975Z project Test run result processed and sent to IDE\n',
    '2022-06-15T17:29:40.333Z workers Started run worker instance (delayed) #0\n',
    '2022-06-15T17:29:56.272Z fs No metadata for added file found: .git/FETCH_HEAD\n',
    '2022-06-15T17:29:58.093Z fs File changed: .git/FETCH_HEAD\n',
    '2022-06-15T17:29:58.093Z fs No metadata for changed file found: .git/FETCH_HEAD\n',
    '2022-06-15T17:30:16.110Z fs File changed: libs/store/test/helpers/rootHooks.js\n',
    '2022-06-15T17:30:16.110Z fs No metadata for added file found: .git/index\n',
    '2022-06-15T17:30:16.110Z fs File changed: .git/index\n',
    '2022-06-15T17:30:16.110Z fs No metadata for changed file found: .git/index\n',
    '2022-06-15T17:30:16.119Z project Running postprocessor\n',
    '2022-06-15T17:30:16.119Z testTask Test files from affected: 0, from deleted or manually requested: 0, from recently changed: 0, from loaded by: 0, from failing: 0\n',
    '2022-06-15T17:30:16.119Z project Postprocessor execution finished\n',
    '2022-06-15T17:30:16.119Z project Test run started; run priority: 2\n',
    '2022-06-15T17:30:16.119Z testTask Test files from affected: 0, from deleted or manually requested: 0, from recently changed: 0, from loaded by: 0, from failing: 0\n',
    '2022-06-15T17:30:16.120Z project Test task priority upgraded to full run\n',
    '2022-06-15T17:30:16.120Z workers Starting test run, priority: 3\n',
    '2022-06-15T17:30:16.120Z workers Distributing tests between 8 workers\n',
    '2022-06-15T17:30:16.120Z workers Running tests in parallel\n',
    '2022-06-15T17:30:16.120Z nodeRunner Starting sandbox [worker #0, session #lejvl]\n',
    '2022-06-15T17:30:16.120Z nodeRunner Starting sandbox [worker #1, session #hryhg]\n',
    '2022-06-15T17:30:16.120Z nodeRunner Starting sandbox [worker #2, session #gb6u1]\n',
    '2022-06-15T17:30:16.120Z nodeRunner Starting sandbox [worker #3, session #iswsd]\n',
    '2022-06-15T17:30:16.120Z nodeRunner Preparing sandbox [worker #0, session #lejvl]\n',
    '2022-06-15T17:30:16.120Z nodeRunner Preparing sandbox [worker #1, session #hryhg]\n',
    '2022-06-15T17:30:16.120Z nodeRunner Preparing sandbox [worker #2, session #gb6u1]\n',
    '2022-06-15T17:30:16.120Z nodeRunner Preparing sandbox [worker #3, session #iswsd]\n',
    '2022-06-15T17:30:16.120Z nodeRunner Prepared sandbox [worker #0, session #lejvl]\n',
    '2022-06-15T17:30:16.120Z nodeRunner Prepared sandbox [worker #1, session #hryhg]\n',
    '2022-06-15T17:30:16.120Z nodeRunner Prepared sandbox [worker #2, session #gb6u1]\n',
    '2022-06-15T17:30:16.120Z nodeRunner Prepared sandbox [worker #3, session #iswsd]\n',
    '2022-06-15T17:30:16.120Z workers [worker #0, session #lejvl] Running tests in sandbox\n',
    '2022-06-15T17:30:16.120Z workers [worker #1, session #hryhg] Running tests in sandbox\n',
    '2022-06-15T17:30:16.120Z workers [worker #2, session #gb6u1] Running tests in sandbox\n',
    '2022-06-15T17:30:16.120Z workers [worker #3, session #iswsd] Running tests in sandbox\n',
    '2022-06-15T17:30:16.186Z workers [lejvl] Loaded 1 test(s)\n',
    '2022-06-15T17:30:16.187Z workers [iswsd] Loaded 2 test(s)\n',
    '2022-06-15T17:30:16.187Z workers [gb6u1] Loaded 1 test(s)\n',
    '2022-06-15T17:30:16.187Z workers [hryhg] Loaded 1 test(s)\n',
    '2022-06-15T17:30:16.189Z workers [hryhg] Test executed: should pass valid operations\n',
    '2022-06-15T17:30:16.189Z workers [lejvl] Test executed: should pass valid operations\n',
    '2022-06-15T17:30:16.191Z workers [lejvl] Run 1 test(s), skipped 0 test(s)\n',
    '2022-06-15T17:30:16.191Z workers [hryhg] Run 1 test(s), skipped 0 test(s)\n',
    '2022-06-15T17:30:16.191Z workers [lejvl] Sandbox is responsive, closing it\n',
    '2022-06-15T17:30:16.191Z workers Recyling run worker instance #0\n',
    '2022-06-15T17:30:16.191Z workers Starting run worker instance #0\n',
    '2022-06-15T17:30:16.196Z workers [hryhg] Sandbox is responsive, closing it\n',
    '2022-06-15T17:30:16.196Z workers Recyling run worker instance #1\n',
    '2022-06-15T17:30:16.196Z workers Starting run worker instance #1\n',
    '2022-06-15T17:30:16.227Z workers [gb6u1] Test executed: should pass valid operations\n',
    '2022-06-15T17:30:16.230Z workers [gb6u1] Run 1 test(s), skipped 0 test(s)\n',
    '2022-06-15T17:30:16.233Z workers [gb6u1] Sandbox is responsive, closing it\n',
    '2022-06-15T17:30:16.234Z workers Recyling run worker instance #2\n',
    '2022-06-15T17:30:16.234Z workers Starting run worker instance #2\n',
    '2022-06-15T17:30:16.588Z workers Started run worker instance (delayed) #0\n',
    '2022-06-15T17:30:16.594Z fs File changed: .git/FETCH_HEAD\n',
    '2022-06-15T17:30:16.594Z fs No metadata for changed file found: .git/FETCH_HEAD\n',
    '2022-06-15T17:30:16.595Z workers Started run worker instance (delayed) #1\n',
    '2022-06-15T17:30:16.620Z workers Started run worker instance (delayed) #2\n',
    '2022-06-15T17:30:16.729Z workers [iswsd] Test executed: should pass valid operations\n',
    '2022-06-15T17:30:16.899Z workers [iswsd] Test executed: should pass valid operations\n',
    '2022-06-15T17:30:16.903Z workers [iswsd] Run 2 test(s), skipped 0 test(s)\n',
    '2022-06-15T17:30:16.904Z workers [iswsd] Sandbox is responsive, closing it\n',
    '2022-06-15T17:30:16.904Z workers Recyling run worker instance #3\n',
    '2022-06-15T17:30:16.905Z workers Starting run worker instance #3\n',
    '2022-06-15T17:30:16.905Z workers Merging parallel test run results\n',
    '2022-06-15T17:30:16.905Z project Test run finished\n',
    '2022-06-15T17:30:16.905Z project Processed console.log entries\n',
    '2022-06-15T17:30:16.905Z project Processed loading sequences\n',
    '2022-06-15T17:30:16.905Z project Test name duplicate: should pass valid operations\n',
    '2022-06-15T17:30:16.906Z project Processed executed tests\n',
    '2022-06-15T17:30:16.906Z project Processed code coverage\n',
    '2022-06-15T17:30:16.911Z project Test run result processed and sent to IDE\n',
    '2022-06-15T17:30:17.263Z workers Started run worker instance (delayed) #3\n',
    '2022-06-15T17:30:18.975Z fs File changed: .git/FETCH_HEAD\n',
    '2022-06-15T17:30:18.975Z fs No metadata for changed file found: .git/FETCH_HEAD\n',
    '2022-06-15T17:30:32.747Z fs File changed: .git/FETCH_HEAD\n',
    '2022-06-15T17:30:32.747Z fs No metadata for changed file found: .git/FETCH_HEAD\n',
    '2022-06-15T17:30:34.899Z fs File changed in editor: libs/store/test/utils/Bar.test.ts\n',
    '2022-06-15T17:30:34.903Z project Running postprocessor\n',
    '2022-06-15T17:30:34.903Z testTask Test files from affected: 1, from deleted or manually requested: 0, from recently changed: 0, from loaded by: 0, from failing: 0\n',
    '2022-06-15T17:30:34.916Z project Postprocessor execution finished\n',
    '2022-06-15T17:30:34.916Z project Test run started; run priority: 2\n',
    '2022-06-15T17:30:34.917Z testTask Test files from affected: 1, from deleted or manually requested: 0, from recently changed: 0, from loaded by: 0, from failing: 0\n',
    '2022-06-15T17:30:34.917Z workers Starting test run, priority: 2\n',
    '2022-06-15T17:30:34.917Z nodeRunner Starting sandbox [worker #0, session #3r1gy]\n',
    '2022-06-15T17:30:34.917Z nodeRunner Preparing sandbox [worker #0, session #3r1gy]\n',
    '2022-06-15T17:30:34.917Z nodeRunner Prepared sandbox [worker #0, session #3r1gy]\n',
    '2022-06-15T17:30:34.917Z workers [worker #0, session #3r1gy] Running tests in sandbox\n',
    '2022-06-15T17:30:34.976Z workers [3r1gy] Loaded 2 test(s)\n',
    '2022-06-15T17:30:35.315Z fs File changed: .git/FETCH_HEAD\n',
    '2022-06-15T17:30:35.315Z fs No metadata for changed file found: .git/FETCH_HEAD\n',
    '2022-06-15T17:30:35.315Z fs File changed: libs/store/test/utils/Bar.test.ts\n',
    '2022-06-15T17:30:35.315Z fs No changes detected for libs/store/test/utils/Bar.test.ts\n',
    '2022-06-15T17:30:35.316Z extended-core File was not changed, but file markers may need to be synced\n',
    '2022-06-15T17:30:35.415Z fs No metadata for added file found: .idea/workspace.xml\n',
    '2022-06-15T17:30:35.516Z workers [3r1gy] Test executed: should pass valid operations\n',
    '2022-06-15T17:30:35.689Z workers [3r1gy] Test executed: should pass valid operations\n',
    '2022-06-15T17:30:35.692Z workers [3r1gy] Run 2 test(s), skipped 0 test(s)\n',
    '2022-06-15T17:30:35.693Z workers [3r1gy] Sandbox is responsive, closing it\n',
    '2022-06-15T17:30:35.693Z workers Recyling run worker instance #0\n',
    '2022-06-15T17:30:35.693Z workers Starting run worker instance #0\n',
    '2022-06-15T17:30:35.693Z project Test run finished\n',
    '2022-06-15T17:30:35.693Z project Processed console.log entries\n',
    '2022-06-15T17:30:35.693Z project Processed loading sequences\n',
    '2022-06-15T17:30:35.693Z project Test name duplicate: should pass valid operations\n',
    '2022-06-15T17:30:35.693Z project Processed executed tests\n',
    '2022-06-15T17:30:35.693Z project Processed code coverage\n',
    '2022-06-15T17:30:35.696Z project Test run result processed and sent to IDE\n',
    '2022-06-15T17:30:36.068Z workers Started run worker instance (delayed) #0\n',
    '2022-06-15T17:31:08.258Z fs File changed in editor: libs/store/test/utils/Bar.test.ts\n',
    '2022-06-15T17:31:08.266Z project Running postprocessor\n',
    '2022-06-15T17:31:08.266Z testTask Test files from affected: 1, from deleted or manually requested: 0, from recently changed: 0, from loaded by: 0, from failing: 0\n',
    '2022-06-15T17:31:08.279Z project Postprocessor execution finished\n',
    '2022-06-15T17:31:08.279Z project Test run started; run priority: 2\n',
    '2022-06-15T17:31:08.279Z testTask Test files from affected: 1, from deleted or manually requested: 0, from recently changed: 0, from loaded by: 0, from failing: 0\n',
    '2022-06-15T17:31:08.279Z workers Starting test run, priority: 2\n',
    '2022-06-15T17:31:08.279Z nodeRunner Starting sandbox [worker #0, session #t8xkx]\n',
    '2022-06-15T17:31:08.279Z nodeRunner Preparing sandbox [worker #0, session #t8xkx]\n',
    '2022-06-15T17:31:08.279Z nodeRunner Prepared sandbox [worker #0, session #t8xkx]\n',
    '2022-06-15T17:31:08.279Z workers [worker #0, session #t8xkx] Running tests in sandbox\n',
    '2022-06-15T17:31:08.358Z workers [t8xkx] Loaded 2 test(s)\n',
    '2022-06-15T17:31:08.360Z fs File changed: libs/store/test/utils/Bar.test.ts\n',
    '2022-06-15T17:31:08.360Z fs No changes detected for libs/store/test/utils/Bar.test.ts\n',
    '2022-06-15T17:31:08.361Z extended-core File was not changed, but file markers may need to be synced\n',
    '2022-06-15T17:31:08.891Z workers [t8xkx] Test executed: should pass valid operations\n',
    '2022-06-15T17:31:09.059Z workers [t8xkx] Test executed: should pass valid operations\n',
    '2022-06-15T17:31:09.061Z workers [t8xkx] Run 2 test(s), skipped 0 test(s)\n',
    '2022-06-15T17:31:09.063Z workers [t8xkx] Sandbox is responsive, closing it\n',
    '2022-06-15T17:31:09.063Z workers Recyling run worker instance #0\n',
    '2022-06-15T17:31:09.063Z workers Starting run worker instance #0\n',
    '2022-06-15T17:31:09.063Z project Test run finished\n',
    '2022-06-15T17:31:09.063Z project Processed console.log entries\n',
    '2022-06-15T17:31:09.063Z project Processed loading sequences\n',
    '2022-06-15T17:31:09.063Z project Test name duplicate: should pass valid operations\n',
    '2022-06-15T17:31:09.063Z project Processed executed tests\n',
    '2022-06-15T17:31:09.063Z project Processed code coverage\n',
    '2022-06-15T17:31:09.065Z project Test run result processed and sent to IDE\n',
    '2022-06-15T17:31:09.462Z workers Started run worker instance (delayed) #0\n',
    '2022-06-15T17:31:21.966Z fs File changed: .git/FETCH_HEAD\n',
    '2022-06-15T17:31:21.966Z fs No metadata for changed file found: .git/FETCH_HEAD\n',
    '2022-06-15T17:31:24.381Z fs File changed: .git/FETCH_HEAD\n',
    '2022-06-15T17:31:24.381Z fs No metadata for changed file found: .git/FETCH_HEAD\n',
    '2022-06-15T17:31:29.888Z fs File changed: .git/FETCH_HEAD\n',
    '2022-06-15T17:31:29.888Z fs No metadata for changed file found: .git/FETCH_HEAD\n',
    '2022-06-15T17:31:32.405Z fs File changed: .git/FETCH_HEAD\n',
    '2022-06-15T17:31:32.405Z fs No metadata for changed file found: .git/FETCH_HEAD\n',
    '2022-06-15T17:31:41.427Z fs File changed in editor: libs/store/src/utils/Bar.ts\n',
    '2022-06-15T17:31:41.434Z project Running postprocessor\n',
    '2022-06-15T17:31:41.435Z testTask Test files from affected: 2, from deleted or manually requested: 0, from recently changed: 0, from loaded by: 0, from failing: 1\n',
    '2022-06-15T17:31:41.449Z project Postprocessor execution finished\n',
    '2022-06-15T17:31:41.449Z project Test run started; run priority: 2\n',
    '2022-06-15T17:31:41.449Z testTask Test files from affected: 2, from deleted or manually requested: 0, from recently changed: 0, from loaded by: 0, from failing: 1\n',
    '2022-06-15T17:31:41.449Z workers Starting test run, priority: 2\n',
    '2022-06-15T17:31:41.449Z workers Distributing tests between 4 workers\n',
    '2022-06-15T17:31:41.449Z workers Running tests in parallel\n',
    '2022-06-15T17:31:41.450Z nodeRunner Starting sandbox [worker #0, session #z11xg]\n',
    '2022-06-15T17:31:41.450Z nodeRunner Starting sandbox [worker #1, session #4wkvb]\n',
    '2022-06-15T17:31:41.450Z nodeRunner Preparing sandbox [worker #0, session #z11xg]\n',
    '2022-06-15T17:31:41.450Z nodeRunner Preparing sandbox [worker #1, session #4wkvb]\n',
    '2022-06-15T17:31:41.450Z nodeRunner Prepared sandbox [worker #0, session #z11xg]\n',
    '2022-06-15T17:31:41.450Z nodeRunner Prepared sandbox [worker #1, session #4wkvb]\n',
    '2022-06-15T17:31:41.450Z workers [worker #0, session #z11xg] Running tests in sandbox\n',
    '2022-06-15T17:31:41.450Z workers [worker #1, session #4wkvb] Running tests in sandbox\n',
    '2022-06-15T17:31:41.521Z workers [4wkvb] Loaded 2 test(s)\n',
    '2022-06-15T17:31:41.521Z workers [z11xg] Loaded 1 test(s)\n',
    '2022-06-15T17:31:41.560Z workers [z11xg] Test executed: should pass valid operations\n',
    '2022-06-15T17:31:41.563Z workers [z11xg] Run 1 test(s), skipped 0 test(s)\n',
    '2022-06-15T17:31:41.563Z workers [z11xg] Sandbox is responsive, closing it\n',
    '2022-06-15T17:31:41.563Z workers Recyling run worker instance #0\n',
    '2022-06-15T17:31:41.563Z workers Starting run worker instance #0\n',
    '2022-06-15T17:31:41.932Z workers Started run worker instance (delayed) #0\n',
    '2022-06-15T17:31:42.045Z fs File changed: libs/store/src/utils/Bar.ts\n',
    '2022-06-15T17:31:42.045Z workers [4wkvb] Test executed: should pass valid operations\n',
    '2022-06-15T17:31:42.045Z fs No changes detected for libs/store/src/utils/Bar.ts\n',
    '2022-06-15T17:31:42.046Z extended-core File was not changed, but file markers may need to be synced\n',
    '2022-06-15T17:31:42.146Z fs No metadata for added file found: .idea/git_toolbox_prj.xml\n',
    '2022-06-15T17:31:42.146Z fs File changed: .idea/workspace.xml\n',
    '2022-06-15T17:31:42.146Z fs No metadata for changed file found: .idea/workspace.xml\n',
    '2022-06-15T17:31:42.209Z workers [4wkvb] Test executed: should pass valid operations\n',
    '2022-06-15T17:31:42.213Z workers [4wkvb] Run 2 test(s), skipped 0 test(s)\n',
    '2022-06-15T17:31:42.214Z workers [4wkvb] Sandbox is responsive, closing it\n',
    '2022-06-15T17:31:42.214Z workers Recyling run worker instance #1\n',
    '2022-06-15T17:31:42.214Z workers Starting run worker instance #1\n',
    '2022-06-15T17:31:42.214Z workers Merging parallel test run results\n',
    '2022-06-15T17:31:42.214Z project Test run finished\n',
    '2022-06-15T17:31:42.215Z project Processed console.log entries\n',
    '2022-06-15T17:31:42.215Z project Processed loading sequences\n',
    '2022-06-15T17:31:42.215Z project Test name duplicate: should pass valid operations\n',
    '2022-06-15T17:31:42.215Z project Processed executed tests\n',
    '2022-06-15T17:31:42.215Z project Processed code coverage\n',
    '2022-06-15T17:31:42.218Z project Test run result processed and sent to IDE\n',
    '2022-06-15T17:31:42.598Z workers Started run worker instance (delayed) #1\n',
    '2022-06-15T17:31:44.620Z fs File changed in editor: libs/store/src/utils/Bar.ts\n',
    '2022-06-15T17:31:44.624Z project Running postprocessor\n',
    '2022-06-15T17:31:44.625Z testTask Test files from affected: 2, from deleted or manually requested: 0, from recently changed: 0, from loaded by: 0, from failing: 1\n',
    '2022-06-15T17:31:44.642Z project Postprocessor execution finished\n',
    '2022-06-15T17:31:44.642Z project Test run started; run priority: 2\n',
    '2022-06-15T17:31:44.642Z testTask Test files from affected: 2, from deleted or manually requested: 0, from recently changed: 0, from loaded by: 0, from failing: 1\n',
    '2022-06-15T17:31:44.643Z workers Starting test run, priority: 2\n',
    '2022-06-15T17:31:44.643Z workers Distributing tests between 4 workers\n',
    '2022-06-15T17:31:44.643Z workers Running tests in parallel\n',
    '2022-06-15T17:31:44.643Z nodeRunner Starting sandbox [worker #0, session #nzqz9]\n',
    '2022-06-15T17:31:44.643Z nodeRunner Starting sandbox [worker #1, session #ou85t]\n',
    '2022-06-15T17:31:44.643Z nodeRunner Preparing sandbox [worker #0, session #nzqz9]\n',
    '2022-06-15T17:31:44.643Z nodeRunner Preparing sandbox [worker #1, session #ou85t]\n',
    '2022-06-15T17:31:44.643Z nodeRunner Prepared sandbox [worker #0, session #nzqz9]\n',
    '2022-06-15T17:31:44.643Z nodeRunner Prepared sandbox [worker #1, session #ou85t]\n',
    '2022-06-15T17:31:44.643Z workers [worker #0, session #nzqz9] Running tests in sandbox\n',
    '2022-06-15T17:31:44.643Z workers [worker #1, session #ou85t] Running tests in sandbox\n',
    '2022-06-15T17:31:44.704Z workers [nzqz9] Loaded 1 test(s)\n',
    '2022-06-15T17:31:44.709Z workers [ou85t] Loaded 2 test(s)\n',
    '2022-06-15T17:31:44.730Z fs File changed: libs/store/src/utils/Bar.ts\n',
    '2022-06-15T17:31:44.731Z fs No changes detected for libs/store/src/utils/Bar.ts\n',
    '2022-06-15T17:31:44.731Z extended-core File was not changed, but file markers may need to be synced\n',
    '2022-06-15T17:31:44.743Z workers [nzqz9] Test executed: should pass valid operations\n',
    '2022-06-15T17:31:44.747Z workers [nzqz9] Run 1 test(s), skipped 0 test(s)\n',
    '2022-06-15T17:31:44.748Z workers [nzqz9] Sandbox is responsive, closing it\n',
    '2022-06-15T17:31:44.748Z workers Recyling run worker instance #0\n',
    '2022-06-15T17:31:44.748Z workers Starting run worker instance #0\n',
    '2022-06-15T17:31:45.104Z workers Started run worker instance (delayed) #0\n',
    '2022-06-15T17:31:45.242Z workers [ou85t] Test executed: should pass valid operations\n',
    '2022-06-15T17:31:45.409Z workers [ou85t] Test executed: should pass valid operations\n',
    '2022-06-15T17:31:45.411Z workers [ou85t] Run 2 test(s), skipped 0 test(s)\n',
    '2022-06-15T17:31:45.412Z workers [ou85t] Sandbox is responsive, closing it\n',
    '2022-06-15T17:31:45.412Z workers Recyling run worker instance #1\n',
    '2022-06-15T17:31:45.412Z workers Starting run worker instance #1\n',
    '2022-06-15T17:31:45.412Z workers Merging parallel test run results\n',
    '2022-06-15T17:31:45.412Z project Test run finished\n',
    '2022-06-15T17:31:45.413Z project Processed console.log entries\n',
    '2022-06-15T17:31:45.413Z project Processed loading sequences\n',
    '2022-06-15T17:31:45.413Z project Test name duplicate: should pass valid operations\n',
    '2022-06-15T17:31:45.413Z project Processed executed tests\n',
    '2022-06-15T17:31:45.413Z project Processed code coverage\n',
    '2022-06-15T17:31:45.415Z project Test run result processed and sent to IDE\n',
    '2022-06-15T17:31:45.774Z workers Started run worker instance (delayed) #1\n',
    '2022-06-15T17:31:55.495Z fs No metadata for added file found: .git/objects/34/c918a711bbec7b2febf3d378904f948c2a5efb\n',
    '2022-06-15T17:31:55.496Z fs No metadata for added file found: .git/objects/41/c32e607713b98da2edfbb00678899c56261fb3\n',
    '2022-06-15T17:31:55.496Z fs No metadata for added file found: .git/objects/9c/a67fca2966a39dc9e7db89fbfbd661218b9bf0\n',
    '2022-06-15T17:31:55.496Z fs No metadata for added file found: .git/objects/57/6891263c6e037d0b4516db349e1679f665b737\n',
    '2022-06-15T17:31:55.497Z fs No metadata for added file found: .git/objects/d0/4c1f17a30f10044eb5ac4212d5124aca21c14a\n',
    '2022-06-15T17:31:55.497Z fs No metadata for added file found: .git/objects/37/3f38d1f8bf18fdaba374a5970614a765602361\n',
    '2022-06-15T17:31:55.497Z fs No metadata for added file found: .git/objects/10/9d93e5a8be9b50833d0f3d8dfe332eabde75fe\n',
    '2022-06-15T17:31:55.498Z fs No metadata for added file found: .git/objects/96/08d048760f19aace23cf595c630e90b65ecc1b\n',
    '2022-06-15T17:31:55.498Z fs No metadata for added file found: .git/objects/a2/edb055ad984b108e49840c102d82dbe54406ea\n',
    '2022-06-15T17:31:55.498Z fs No metadata for added file found: .git/objects/f5/0cae2decc579b5441d6db81f1453f660320efd\n',
    '2022-06-15T17:31:55.498Z fs No metadata for added file found: .git/objects/af/d3e99772c5965bb5e0a49181cc02a36a883002\n',
    '2022-06-15T17:31:55.499Z fs No metadata for added file found: .git/objects/bd/57f97e5514ad1229d27daadd308131722fa5cc\n',
    '2022-06-15T17:31:55.499Z fs No metadata for added file found: .git/objects/52/e7878532ea5054de0be593e8e9276541794dbf\n',
    '2022-06-15T17:31:55.499Z fs No metadata for added file found: .git/COMMIT_EDITMSG\n',
    '2022-06-15T17:31:55.499Z fs No metadata for added file found: .git/objects/92/6f25bf2ed1c97ae8dec8b147ee5beb2801528c\n',
    '2022-06-15T17:31:55.499Z fs No metadata for added file found: .git/logs/HEAD\n',
    '2022-06-15T17:31:55.500Z fs No metadata for added file found: .git/logs/refs/heads/main\n',
    '2022-06-15T17:31:55.500Z fs File changed: .git/index\n',
    '2022-06-15T17:31:55.500Z fs No metadata for changed file found: .git/index\n',
    '2022-06-15T17:31:55.500Z fs No metadata for added file found: .git/objects/6b/79f90f4a37ad952d42a2f209e5553a64d63f0d\n',
    '2022-06-15T17:31:55.500Z fs No metadata for added file found: .git/objects/a2/643b48cf941c94e0d466556e88f925e1f28b20\n',
    '2022-06-15T17:31:55.501Z fs No metadata for added file found: .git/refs/heads/main\n',
    '2022-06-15T17:31:55.501Z fs File changed: .git/refs/heads/main\n',
    '2022-06-15T17:31:55.501Z fs No metadata for changed file found: .git/refs/heads/main\n'
  ]
}
smcenlly commented 2 years ago

By design, Wallaby reports console.error messages that are logged during the execution of a test as an error.

In your case, when you use fetch for the first time, node reports the fetch usage as an error. You can disable this behavior using the node flag, --no-warnings. Please change the env runner params of your Wallaby configuration to fix your problem:

wallaby.cjs

...
  return {
...
    env: {
      type: "node",
      params: {
        runner: "--no-warnings --experimental-specifier-resolution=node --experimental-json-modules --experimental-loader " + require('path').join(__dirname, 'loader.js')
      },
      "DOTENV_CONFIG_PATH": ".env"
  },
...
    };
};