wallabyjs / public

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

Covered lines are not showing as covered when I have some imports #3120

Closed OlDashkevych closed 1 year ago

OlDashkevych commented 1 year ago

42bf7179-c6dc-4d5b-a8c6-3a54d91b8d0f e4a8426d-e44f-49fb-9e3c-13cb82071734 3fe4fadb-1b2f-4df0-a69a-9d6a0536136f

smcenlly commented 1 year ago

Can you please share your Wallaby Diagnostics Report. The Wallaby Diagnostics Report is a simple JSON text report that contains some basic information about your Wallaby config and project that is required to start troubleshooting most of Wallaby issues.

Before you generate the report, please try commenting out the import and then uncommenting the import.

To share the report:

OlDashkevych commented 1 year ago
{
  editorVersion: '1.73.1',
  pluginVersion: '1.0.348',
  editorType: 'VSCode',
  osVersion: 'win32 10.0.19044',
  nodeVersion: 'v16.17.0',
  coreVersion: '1.0.1352',
  checksum: '',
  config: {
    files: [
      { pattern: 'src/**/*.js', ignore: false, trigger: true, load: true, instrument: true, order: 1 },
      { pattern: 'src/**/*.test.js', ignore: true, trigger: true, load: true, instrument: true, file: true }
    ],
    tests: [ { pattern: 'src/**/*.test.js', ignore: false, trigger: true, load: true, test: true, order: 2 } ],
    env: { type: 'node', runner: 'node', params: {}, viewportSize: { width: 800, height: 600 }, options: { width: 800, height: 600 }, bundle: true },
    diagnostics: {},
    filesWithNoCoverageCalculated: [],
    runAllTestsInAffectedTestFile: false,
    updateNoMoreThanOneSnapshotPerTestFileRun: false,
    compilers: { '**/*.?(lit)coffee?(.md)': [Function (anonymous)] },
    smartStart: [
      { test: true, source: false, path: 'src/Root/RootStore/Middleware.test.js', startMode: 'always' },
      { test: true, source: false, pattern: '**/*', startMode: 'open' },
      { test: false, source: true, pattern: '**/*', startMode: 'edit' }
    ],
    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 },
    workers: { initial: 0, regular: 0, recycle: false },
    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: true,
    mapConsoleMessagesStackTrace: false,
    extensions: {},
    reportUnhandledPromises: true,
    testFramework: { version: 'mocha@2.1.0', configurator: 'mocha@2.1.0', reporter: 'mocha@2.1.0', starter: 'mocha@2.1.0' },
    slowTestThreshold: 75,
    lowCoverageThreshold: 80,
    runAllTestsWhenNoAffectedTests: true,
    symlinkNodeModules: undefined,
    configCode: 'module.exports = function (w) {\n' +
      '    return {\n' +
      '        files: [\n' +
      "            'src/**/*.js',\n" +
      "            '!src/**/*.test.js'\n" +
      '        ],\n' +
      "        tests: ['src/**/*.test.js'],\n" +
      '        env: {\n' +
      "            type: 'node',\n" +
      "            runner: 'node',\n" +
      '        },\n' +
      '    };\n' +
      '};',
    testLocations: [ 'src/Root/RootStore/Middleware.test.js' ]
  },
  packageJSON: {
    dependencies: {
      '@material-ui/core': '3.6.2',
      '@material-ui/icons': '3.0.1',
      '@nivo/bar': '^0.56.2',
      '@nivo/line': '^0.56.2',
      '@nivo/pie': '^0.56.2',
      '@x-nivo/bullet': '^0.57.12',
      'apollo-react-next': '...',
      'array-sort': '1.0.0',
      'babel-polyfill': '6.26.0',
      classnames: '2.2.6',
      'domain-task': '3.0.3',
      'encoding-japanese': '1.0.30',
      'es6-plato': '1.2.3',
      '...': '0.0.17',
      jsonrepair: '^2.0.1',
      jspdf: '^2.1.0',
      'jspdf-autotable': '^3.5.13',
      'jss-preset-default': '10.0.0',
      'material-ui-apollo': '1.7.0-alpha.54',
      'material-ui-apollo-icons': '1.0.0-alpha.4',
      'mock-socket': '9.0.2',
      moment: '2.24.0',
      'node-fetch': '^3.3.0',
      numeral: '2.0.6',
      'query-string': '4.3.4',
      raf: '3.4.1',
      ramda: '0.26.1',
      'rc-tree': '2.1.3',
      react: '16.11.0',
      'react-beautiful-dnd': '^13.0.0',
      'react-color': '2.17.3',
      'react-dnd': '2.5.4',
      'react-dnd-html5-backend': '2.5.4',
      'react-dnd-test-backend': '2.5.4',
      'react-dom': '^16.11.0',
      'react-dropzone': '^11.2.4',
      'react-ga': '2.7.0',
      'react-hot-loader': '4.12.16',
      'react-intl': '2.9.0',
      'react-jss': '10.0.0',
      'react-redux': '5.1.2',
      'react-router-dom': '5.1.2',
      'react-switch': '5.0.1',
      'react-table': '6.10.3',
      'react-toolbox': '2.0.0-beta.13',
      recharts: '1.8.5',
      recompose: '0.30.0',
      'reduce-reducers': '1.0.4',
      redux: '4.0.4',
      'redux-api-middleware': '3.0.1',
      'redux-form': '7.4.2',
      'redux-logger': '3.0.6',
      'redux-thunk': '2.3.0',
      reselect: '4.0.0',
      'roboto-fontface': '0.10.0',
      'set-tz': '^0.2.0',
      'typeface-nunito-sans': '0.0.72',
      uuid: '^8.3.2',
      'vis-postmonger': '0.0.13',
      'x-react-breadcrumbs': '2.1.7',
      'xml-beautify': '^1.1.1'
    },
    devDependencies: {
      cheerio: '^1.0.0-rc.1',
      'cross-env': '6.0.3',
      enzyme: '3.10.0',
      'enzyme-adapter-react-16': '1.15.1',
      'enzyme-to-json': '3.4.3',
      eslint: '6.1.0',
      '...': '0.0.22',
      husky: '3.0.9',
      'jest-canvas-mock': '^2.3.1',
      'jest-enzyme': '7.1.2',
      'jest-fetch-mock': '2.1.2',
      'jest-junit': '^12.1.0',
      'lint-staged': '9.4.2',
      mockdate: '2.0.5',
      'react-app-rewire-hot-loader': '1.0.3',
      'react-app-rewired': '1.6.2',
      'react-scripts': '1.1.5',
      'react-test-renderer': '16.11.0',
      'react-toolbox-themr': '1.0.2',
      'redux-mock-store': '1.5.3'
    }
  },
  fs: { numberOfFiles: 44 },
  debug: [
    '2022-12-08T07:42:23.053Z project Wallaby Node version: v16.17.0\n',
    '2022-12-08T07:42:23.053Z project Wallaby config: C:\\Users\\...',
    '2022-12-08T07:42:23.063Z fs File system starting\n',
    '2022-12-08T07:42:23.146Z fs File system scan completed\n',
    '2022-12-08T07:42:23.152Z project File cache: C:\\Users\\...',
    '2022-12-08T07:42:23.293Z uiService Listening port 51235\n',
    '2022-12-08T07:42:23.306Z project Config file change detected, invalidating local cache\n',
    '2022-12-08T07:42:23.337Z workers Parallelism for initial run: 6, for regular run: 3\n',
    '2022-12-08T07:42:23.338Z workers Starting run worker instance #0\n',
    '2022-12-08T07:42:23.338Z workers Starting run worker instance #1\n',
    '2022-12-08T07:42:23.338Z workers Starting run worker instance #2\n',
    '2022-12-08T07:42:23.338Z workers Starting run worker instance #3\n',
    '2022-12-08T07:42:23.338Z workers Starting run worker instance #4\n',
    '2022-12-08T07:42:23.338Z workers Starting run worker instance #5\n',
    '2022-12-08T07:42:23.340Z workers Web server is listening at 63472\n',
    '2022-12-08T07:42:23.340Z project File cache requires some updates, waiting required files from IDE\n',
    '2022-12-08T07:42:23.465Z extended-core New file or complex file change\n',
    '2022-12-08T07:42:23.671Z workers Started run worker instance (delayed) #3\n',
    '2022-12-08T07:42:23.672Z workers Started run worker instance (delayed) #1\n',
    '2022-12-08T07:42:23.682Z workers Started run worker instance (delayed) #0\n',
    '2022-12-08T07:42:23.682Z workers Started run worker instance (delayed) #5\n',
    '2022-12-08T07:42:23.718Z workers Started run worker instance (delayed) #2\n',
    '2022-12-08T07:42:23.774Z workers Started run worker instance (delayed) #4\n',
    '2022-12-08T07:42:24.539Z project Stopping process pool\n',
    '2022-12-08T07:42:24.542Z project Running postprocessor\n',
    '2022-12-08T07:42:24.552Z postprocessor New TypeScript language service is required\n',
    "2022-12-08T07:42:24.553Z postprocessor TypeScript postprocessor will be removed because in 28 project files none were found by patterns: [ '**/*.ts?(x)' ]\n",
    '2022-12-08T07:42:24.556Z project Postprocessor execution finished\n',
    '2022-12-08T07:42:24.556Z project Postprocessor is removed as requested by itself\n',
    '2022-12-08T07:42:24.556Z project Test run started; run priority: 3\n',
    '2022-12-08T07:42:24.557Z project Running all tests\n',
    '2022-12-08T07:42:24.559Z workers Starting test run, priority: 3\n',
    '2022-12-08T07:42:24.559Z nodeRunner Starting sandbox [worker #0, session #76tly]\n',
    '2022-12-08T07:42:24.559Z nodeRunner Preparing sandbox [worker #0, session #76tly]\n',
    '2022-12-08T07:42:24.559Z nodeRunner Prepared sandbox [worker #0, session #76tly]\n',
    '2022-12-08T07:42:24.559Z workers [worker #0, session #76tly] Running tests in sandbox\n',
    '2022-12-08T07:42:24.576Z workers Sandbox (active) [76tly] error: .\\src\\Root\\RootStore\\Middleware.test.js:2\n' +
      "import Middleware from './Middleware';\n" +
      '^^^^^^\n' +
      '\n' +
      'SyntaxError: Cannot use import statement outside a module\n' +
      '    at Object.compileFunction (node:vm:360:18)\n' +
      '    at wrapSafe (node:internal/modules/cjs/loader:1055:15)\n' +
      '    at Module._compile (node:internal/modules/cjs/loader:1090:27)\n' +
      '    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)\n' +
      '    at Module.load (node:internal/modules/cjs/loader:1004:32)\n' +
      '    at Function.Module._load (node:internal/modules/cjs/loader:839:12)\n' +
      '    at Module.require (node:internal/modules/cjs/loader:1028:19)\n' +
      '    at require (node:internal/modules/cjs/helpers:102:18)\n' +
      '    at Array.forEach (<anonymous>)\n' +
      '    at new Promise (<anonymous>)\n' +
      '    at WebSocket.emit (node:events:513:28)\n' +
      '    at afterWrite (node:internal/streams/writable:499:5)\n' +
      '    at onwrite (node:internal/streams/writable:479:7)\n' +
      '    at Zlib.cb (node:internal/streams/transform:221:7)\n' +
      '    at Zlib.processCallback (node:zlib:613:8)\n',
    '2022-12-08T07:42:24.680Z workers [76tly] Run 0 test(s), skipped 0 test(s)\n',
    '2022-12-08T07:42:24.686Z workers [76tly] Sandbox is responsive, closing it\n',
    '2022-12-08T07:42:24.688Z project Test run finished\n',
    '2022-12-08T07:42:24.689Z project Processed console.log entries\n',
    '2022-12-08T07:42:24.689Z project Processed loading sequences\n',
    '2022-12-08T07:42:24.689Z project Processed executed tests\n',
    '2022-12-08T07:42:24.696Z project Processed code coverage\n',
    '2022-12-08T07:42:24.740Z project Test run result processed and sent to IDE\n',
    '2022-12-08T08:11:46.047Z fs File changed in editor: src/Root/RootStore/Middleware.test.js\n',
    '2022-12-08T08:11:46.066Z project Error: Failed to instrument src/Root/RootStore/Middleware.test.js\n' +
      "> 1 | .import Middleware from './Middleware';\n" +
      '    | ^ SyntaxError: Unexpected token (1:0)\n' +
      '  2 | \n' +
      "  3 | describe('store', () => {\n" +
      '  4 |   const store = {};\n' +
      '    at Object.formatInstrumentationError (c:\\Users\\...\\wallaby501c3c\\server.js:31:15203)\n' +
      '    at c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\server.js:27:13770\n' +
      '    at _rejected (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:864:24)\n' +
      '    at c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:890:30\n' +
      '    at Promise.when (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:1142:31)\n' +
      '    at Promise.promise.promiseDispatch (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:808:41)\n' +
      '    at c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:624:44\n' +
      '    at runSingle (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:137:13)\n' +
      '    at flush (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:125:13)\n' +
      '    at processTicksAndRejections (node:internal/process/task_queues:78:11)\n',
    '2022-12-08T08:11:46.067Z project Changes did not trigger any tests\n',
    '2022-12-08T08:11:46.170Z fs File changed in editor: src/Root/RootStore/Middleware.test.js\n',
    '2022-12-08T08:11:46.185Z project Error: Failed to instrument src/Root/RootStore/Middleware.test.js\n' +
      "> 1 | ..import Middleware from './Middleware';\n" +
      '    | ^ SyntaxError: Unexpected token (1:0)\n' +
      '  2 | \n' +
      "  3 | describe('store', () => {\n" +
      '  4 |   const store = {};\n' +
      '    at Object.formatInstrumentationError (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\server.js:31:15203)\n' +
      '    at c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\server.js:27:13770\n' +
      '    at _rejected (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:864:24)\n' +
      '    at c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:890:30\n' +
      '    at Promise.when (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:1142:31)\n' +
      '    at Promise.promise.promiseDispatch (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:808:41)\n' +
      '    at c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:624:44\n' +
      '    at runSingle (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:137:13)\n' +
      '    at flush (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:125:13)\n' +
      '    at processTicksAndRejections (node:internal/process/task_queues:78:11)\n',
    '2022-12-08T08:11:46.185Z project Changes did not trigger any tests\n',
    '2022-12-08T08:11:47.102Z fs File changed in editor: src/Root/RootStore/Middleware.test.js\n',
    '2022-12-08T08:11:47.118Z project Error: Failed to instrument src/Root/RootStore/Middleware.test.js\n' +
      "> 1 | .import Middleware from './Middleware';\n" +
      '    | ^ SyntaxError: Unexpected token (1:0)\n' +
      '  2 | \n' +
      "  3 | describe('store', () => {\n" +
      '  4 |   const store = {};\n' +
      '    at Object.formatInstrumentationError (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\server.js:31:15203)\n' +
      '    at c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\server.js:27:13770\n' +
      '    at _rejected (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:864:24)\n' +
      '    at c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:890:30\n' +
      '    at Promise.when (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:1142:31)\n' +
      '    at Promise.promise.promiseDispatch (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:808:41)\n' +
      '    at c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:624:44\n' +
      '    at runSingle (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:137:13)\n' +
      '    at flush (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:125:13)\n' +
      '    at processTicksAndRejections (node:internal/process/task_queues:78:11)\n',
    '2022-12-08T08:11:47.118Z project Changes did not trigger any tests\n',
    '2022-12-08T08:11:47.252Z fs File changed in editor: src/Root/RootStore/Middleware.test.js\n',
    '2022-12-08T08:11:47.288Z project Test run started; run priority: 2\n',
    '2022-12-08T08:11:47.289Z 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-12-08T08:11:47.289Z testTask Running only selected or not excluded tests\n',
    '2022-12-08T08:11:47.289Z workers Starting test run, priority: 2\n',
    '2022-12-08T08:11:47.289Z nodeRunner Starting sandbox [worker #0, session #ntixe]\n',
    '2022-12-08T08:11:47.289Z nodeRunner Preparing sandbox [worker #0, session #ntixe]\n',
    '2022-12-08T08:11:47.289Z nodeRunner Prepared sandbox [worker #0, session #ntixe]\n',
    '2022-12-08T08:11:47.290Z workers [worker #0, session #ntixe] Running tests in sandbox\n',
    '2022-12-08T08:11:47.292Z workers Sandbox (active) [ntixe] error: .\\src\\Root\\RootStore\\Middleware.test.js:2\n' +
      "import Middleware from './Middleware';\n" +
      '^^^^^^\n' +
      '\n' +
      'SyntaxError: Cannot use import statement outside a module\n' +
      '    at Object.compileFunction (node:vm:360:18)\n' +
      '    at wrapSafe (node:internal/modules/cjs/loader:1055:15)\n' +
      '    at Module._compile (node:internal/modules/cjs/loader:1090:27)\n' +
      '    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)\n' +
      '    at Module.load (node:internal/modules/cjs/loader:1004:32)\n' +
      '    at Function.Module._load (node:internal/modules/cjs/loader:839:12)\n' +
      '    at Module.require (node:internal/modules/cjs/loader:1028:19)\n' +
      '    at require (node:internal/modules/cjs/helpers:102:18)\n' +
      '    at Array.forEach (<anonymous>)\n' +
      '    at new Promise (<anonymous>)\n' +
      '    at WebSocket.emit (node:events:513:28)\n' +
      '    at afterWrite (node:internal/streams/writable:499:5)\n' +
      '    at onwrite (node:internal/streams/writable:479:7)\n' +
      '    at Zlib.cb (node:internal/streams/transform:221:7)\n' +
      '    at Zlib.processCallback (node:zlib:613:8)\n',
    '2022-12-08T08:11:47.396Z workers [ntixe] Run 0 test(s), skipped 0 test(s)\n',
    '2022-12-08T08:11:47.400Z workers [ntixe] Sandbox is responsive, closing it\n',
    '2022-12-08T08:11:47.400Z project Test run finished\n',
    '2022-12-08T08:11:47.400Z project Processed console.log entries\n',
    '2022-12-08T08:11:47.400Z project Processed loading sequences\n',
    '2022-12-08T08:11:47.400Z project Processed executed tests\n',
    '2022-12-08T08:11:47.401Z project Processed code coverage\n',
    '2022-12-08T08:11:47.403Z project Test run result processed and sent to IDE\n',
    '2022-12-08T08:11:48.270Z fs File changed in editor: src/Root/RootStore/Middleware.test.js\n',
    '2022-12-08T08:11:48.274Z project Error: Failed to instrument src/Root/RootStore/Middleware.test.js\n' +
      "> 1 | /import Middleware from './Middleware';\n" +
      '    |  ^ SyntaxError: Invalid regular expression flag (1:1)\n' +
      '  2 | \n' +
      "  3 | describe('store', () => {\n" +
      '  4 |   const store = {};\n' +
      '    at Object.formatInstrumentationError (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\server.js:31:15203)\n' +
      '    at c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\server.js:27:13770\n' +
      '    at _rejected (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:864:24)\n' +
      '    at c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:890:30\n' +
      '    at Promise.when (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:1142:31)\n' +
      '    at Promise.promise.promiseDispatch (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:808:41)\n' +
      '    at c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:624:44\n' +
      '    at runSingle (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:137:13)\n' +
      '    at flush (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:125:13)\n' +
      '    at processTicksAndRejections (node:internal/process/task_queues:78:11)\n',
    '2022-12-08T08:11:48.274Z project Changes did not trigger any tests\n',
    '2022-12-08T08:11:48.422Z fs File changed in editor: src/Root/RootStore/Middleware.test.js\n',
    '2022-12-08T08:11:48.453Z project Test run started; run priority: 2\n',
    '2022-12-08T08:11:48.453Z 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-12-08T08:11:48.453Z testTask Running only selected or not excluded tests\n',
    '2022-12-08T08:11:48.453Z workers Starting test run, priority: 2\n',
    '2022-12-08T08:11:48.453Z nodeRunner Starting sandbox [worker #0, session #a4z9k]\n',
    '2022-12-08T08:11:48.453Z nodeRunner Preparing sandbox [worker #0, session #a4z9k]\n',
    '2022-12-08T08:11:48.453Z nodeRunner Prepared sandbox [worker #0, session #a4z9k]\n',
    '2022-12-08T08:11:48.453Z workers [worker #0, session #a4z9k] Running tests in sandbox\n',
    '2022-12-08T08:11:48.458Z workers [a4z9k] Loaded 2 test(s)\n',
    '2022-12-08T08:11:48.460Z workers [a4z9k] Test executed: store to be called correctly case 1\n',
    '2022-12-08T08:11:48.461Z workers [a4z9k] Test executed: store to be called correctly case 2\n',
    '2022-12-08T08:11:48.466Z workers [a4z9k] Run 2 test(s), skipped 0 test(s)\n',
    '2022-12-08T08:11:48.468Z workers [a4z9k] Sandbox is responsive, closing it\n',
    '2022-12-08T08:11:48.468Z project Test run finished\n',
    '2022-12-08T08:11:48.468Z project Processed console.log entries\n',
    '2022-12-08T08:11:48.468Z project Processed loading sequences\n',
    '2022-12-08T08:11:48.468Z project Processed executed tests\n',
    '2022-12-08T08:11:48.469Z project Processed code coverage\n',
    '2022-12-08T08:11:48.474Z project Test run result processed and sent to IDE\n',
    '2022-12-08T08:11:48.635Z fs File changed: src/Root/RootStore/Middleware.test.js\n',
    '2022-12-08T08:11:48.670Z fs No changes detected for src/Root/RootStore/Middleware.test.js\n',
    '2022-12-08T08:11:48.671Z extended-core File was not changed, but file markers may need to be synced\n',
    '2022-12-08T08:11:55.491Z fs File changed in editor: src/Root/RootStore/Middleware.test.js\n',
    '2022-12-08T08:11:55.508Z project Error: Failed to instrument src/Root/RootStore/Middleware.test.js\n' +
      "> 1 | /import Middleware from './Middleware';\n" +
      '    |  ^ SyntaxError: Invalid regular expression flag (1:1)\n' +
      '  2 | \n' +
      "  3 | describe('store', () => {\n" +
      '  4 |   const store = {};\n' +
      '    at Object.formatInstrumentationError (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\server.js:31:15203)\n' +
      '    at c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\server.js:27:13770\n' +
      '    at _rejected (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:864:24)\n' +
      '    at c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:890:30\n' +
      '    at Promise.when (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:1142:31)\n' +
      '    at Promise.promise.promiseDispatch (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:808:41)\n' +
      '    at c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:624:44\n' +
      '    at runSingle (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:137:13)\n' +
      '    at flush (c:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\wallaby501c3c\\node_modules\\q\\q.js:125:13)\n' +
      '    at processTicksAndRejections (node:internal/process/task_queues:78:11)\n',
    '2022-12-08T08:11:55.508Z project Changes did not trigger any tests\n',
    '2022-12-08T08:11:55.661Z fs File changed in editor: src/Root/RootStore/Middleware.test.js\n',
    '2022-12-08T08:11:55.672Z project Test run started; run priority: 2\n',
    '2022-12-08T08:11:55.672Z 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-12-08T08:11:55.672Z testTask Running only selected or not excluded tests\n',
    '2022-12-08T08:11:55.673Z workers Starting test run, priority: 2\n',
    '2022-12-08T08:11:55.673Z nodeRunner Starting sandbox [worker #0, session #49qob]\n',
    '2022-12-08T08:11:55.673Z nodeRunner Preparing sandbox [worker #0, session #49qob]\n',
    '2022-12-08T08:11:55.673Z nodeRunner Prepared sandbox [worker #0, session #49qob]\n',
    '2022-12-08T08:11:55.673Z workers [worker #0, session #49qob] Running tests in sandbox\n',
    '2022-12-08T08:11:55.675Z workers Sandbox (active) [49qob] error: .\\src\\Root\\RootStore\\Middleware.test.js:2\n' +
      "import Middleware from './Middleware';\n" +
      '^^^^^^\n' +
      '\n' +
      'SyntaxError: Cannot use import statement outside a module\n' +
      '    at Object.compileFunction (node:vm:360:18)\n' +
      '    at wrapSafe (node:internal/modules/cjs/loader:1055:15)\n' +
      '    at Module._compile (node:internal/modules/cjs/loader:1090:27)\n' +
      '    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)\n' +
      '    at Module.load (node:internal/modules/cjs/loader:1004:32)\n' +
      '    at Function.Module._load (node:internal/modules/cjs/loader:839:12)\n' +
      '    at Module.require (node:internal/modules/cjs/loader:1028:19)\n' +
      '    at require (node:internal/modules/cjs/helpers:102:18)\n' +
      '    at Array.forEach (<anonymous>)\n' +
      '    at new Promise (<anonymous>)\n' +
      '    at WebSocket.emit (node:events:513:28)\n' +
      '    at afterWrite (node:internal/streams/writable:499:5)\n' +
      '    at onwrite (node:internal/streams/writable:479:7)\n' +
      '    at Zlib.cb (node:internal/streams/transform:221:7)\n' +
      '    at Zlib.processCallback (node:zlib:613:8)\n',
    '2022-12-08T08:11:55.784Z workers [49qob] Run 0 test(s), skipped 0 test(s)\n',
    '2022-12-08T08:11:55.786Z workers [49qob] Sandbox is responsive, closing it\n',
    '2022-12-08T08:11:55.786Z project Test run finished\n',
    '2022-12-08T08:11:55.786Z project Processed console.log entries\n',
    '2022-12-08T08:11:55.786Z project Processed loading sequences\n',
    '2022-12-08T08:11:55.786Z project Processed executed tests\n',
    '2022-12-08T08:11:55.786Z project Processed code coverage\n',
    '2022-12-08T08:11:55.788Z project Test run result processed and sent to IDE\n',
    '2022-12-08T08:11:56.275Z fs File changed: src/Root/RootStore/Middleware.test.js\n',
    '2022-12-08T08:11:56.310Z fs No changes detected for src/Root/RootStore/Middleware.test.js\n',
    '2022-12-08T08:11:56.311Z extended-core File was not changed, but file markers may need to be synced\n'
  ]
}
OlDashkevych commented 1 year ago

Some lines have been edited for security reasons

smcenlly commented 1 year ago

It looks like you are getting errors in your import statements, which is why you're not seeing code coverage after adding the imports (because your code stops executing after it encounters an error).

I assume that your tests are running with mocha from the command-line without any transformations and that you have "type": "module" in your package.json.

While Mocha supports ES modules, Mocha in watch mode does not. This means that Wallaby needs to be configured to reflect the limitation and to restart its worker processes between test runs. You also need to include your package.json file in your files section so that Wallaby/Mocha know to run using ES Modules instead of commonjs.

module.exports = function (w) {
  return {
    files: [
      // IMPORTANT
      'package.json',
      'src/**/*.js',
      '!src/**/*.test.js'
    ],
    tests: ['src/**/*.test.js'],
    env: {
      type: 'node',
      runner: 'node',
    },

    // not required if `package.json` contains `"type": "module"`
    symlinkNodeModules: true,

    // IMPORTANT
    workers: { restart: true }
  };
};

If that doesn't help and you're still having problems, can you please detail how you are running your tests from the command-line?

OlDashkevych commented 1 year ago

Now I have the following debug and no coverage points when I executed the wallaby start command. To run tests I use next command in the powershell: yarn test --testMatch '/src//*.test.js' --watchAll

in package.json: "test": "cross-env react-app-rewired test --ci --env=jsdom --setupFiles ./test-setup.js --coverageDirectory='./artifacts/coverage'"

`debug: [ 
    '2022-12-12T10:47:39.581Z project Wallaby Node version: v16.17.0\n', 
    '2022-12-12T10:47:39.581Z project Wallaby config: C:\\Users\...\\Desktop\...\\src\...\\ClientApp\\wallaby.js\n', 
    '2022-12-12T10:47:39.595Z fs File system starting\n', 
    '2022-12-12T10:47:39.683Z fs File system scan completed\n', 
    '2022-12-12T10:47:39.689Z project File cache: C:\\Users\\...\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.348\\projects\\8c30891294267bff\n', 
    '2022-12-12T10:47:39.829Z uiService Listening port 51235\n', 
    '2022-12-12T10:47:39.846Z workers Parallelism for initial run: 6, for regular run: 3\n', 
    '2022-12-12T10:47:39.846Z workers Starting run worker instance #0\n', 
    '2022-12-12T10:47:39.846Z workers Starting run worker instance #1\n', 
    '2022-12-12T10:47:39.846Z workers Starting run worker instance #2\n', 
    '2022-12-12T10:47:39.846Z workers Starting run worker instance #3\n', 
    '2022-12-12T10:47:39.846Z workers Starting run worker instance #4\n', 
    '2022-12-12T10:47:39.846Z workers Starting run worker instance #5\n', 
    '2022-12-12T10:47:39.849Z workers Web server is listening at 51133\n', 
    '2022-12-12T10:47:40.259Z workers Started run worker instance (delayed) #0\n', 
    '2022-12-12T10:47:40.262Z workers Started run worker instance (delayed) #1\n', 
    '2022-12-12T10:47:40.262Z workers Started run worker instance (delayed) #4\n', 
    '2022-12-12T10:47:40.283Z workers Started run worker instance (delayed) #5\n', 
    '2022-12-12T10:47:40.290Z workers Started run worker instance (delayed) #3\n', 
    '2022-12-12T10:47:40.290Z workers Started run worker instance (delayed) #2\n', 
    '2022-12-12T10:47:40.498Z project Stopping process pool\n' 
  ]`

230b0c8c-ba33-41a3-96c9-c5cf93b7ae6c f4ef06c9-546d-4bbd-beb0-bdf703c0fec9

smcenlly commented 1 year ago

Thanks for providing details of how you are running your tests from your scripts. Since you are using react-app-rewired, jest will be running your project's scripts. Before now, we had assumed you were using mocha based on the configuration file you provided.

Have you tried using Wallaby's automatic configuration? Wallaby's automatic configuration works with react-app-rewired but given you are configuring jest in your script, you may run into some problems. To get Wallaby working, you will need to update your config overrides so that you can run your tests from the CLI with "test": "react-app-rewired test", then Wallaby should work for you.

If you're still having problems, please provide us with a sample proejct similar to your project, with the same configuration as your current project with a single sample test (don't need any project code). If your sample project works from the CLI and not with Wallaby, we should be able to help you get Wallaby working.

smcenlly commented 1 year ago

Assuming my last comment helped. If you're still having problems, please provide us with a sample proejct similar to your project, with the same configuration as your current project with a single sample test (don't need any project code).

Closing the issue until/unless we hear back.