Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jasmine is not defined in 1.0.205 #2430

Closed
ioandev opened this issue May 29, 2020 · 11 comments
Closed

jasmine is not defined in 1.0.205 #2430

ioandev opened this issue May 29, 2020 · 11 comments

Comments

@ioandev
Copy link

ioandev commented May 29, 2020

Getting a variation of the error jasmine is not defined in a few projects, including one of yours.

Steps to reproduce:

  1. Clone https://github.com/wallabyjs/wallaby-jest-snapshots
  2. npm install
  3. Run wallaby
ReferenceError: jasmine is not defined 
    at Runtime._execModule (.\node_modules\jest-runtime\build\index.js:1204:24) 
    at Runtime._loadModule (.\node_modules\jest-runtime\build\index.js:815:12) 
    at Runtime.requireModule (.\node_modules\jest-runtime\build\index.js:676:10) 
    at jasmine2 (.\node_modules\jest-jasmine2\build\index.js:204:15) 
    at runTestInternal (.\node_modules\jest-runner\build\runTest.js:374:22) 
    at process._tickCallback (internal/process/next_tick.js:68:7)

Wallaby diagnostics report

{ editorVersion: '1.45.1',
  pluginVersion: '1.0.205',
  editorType: 'VSCode',
  osVersion: 'win32 10.0.18363',
  nodeVersion: 'v10.14.1',
  coreVersion: '1.0.900',
  config:
   { files:
      [ { pattern: 'src/**/*.js?(x)', ignore: false, trigger: true, load: true, instrument: true, order: 1 },
        { pattern: 'src/**/*.spec.js?(x)', ignore: true, trigger: true, load: true, instrument: true },
        { pattern: 'src/**/*.spec.js?(x).snap', ignore: false, instrument: false, trigger: true, load: true, order: 2 },
        { pattern: 'package.json', ignore: false, instrument: false, trigger: true, load: true, order: 3 } ],
     tests: [ { pattern: 'src/**/*.spec.js?(x)', ignore: false, trigger: true, load: true, test: true, order: 4 } ],
     env: { type: 'node', runner: 'node', params: {}, viewportSize: { width: 800, height: 600 }, options: { width: 800, height: 600 }, bundle: true },
     compilers: { '**/*.js?(x)': [Function], '**/*.?(lit)coffee?(.md)': [Function] },
     testFramework: { version: '[email protected]', configurator: '[email protected]', reporter: '[email protected]', starter: '[email protected]' },
     debug: true,
     diagnostics: {},
     filesWithNoCoverageCalculated: [],
     runAllTestsInAffectedTestFile: false,
     updateNoMoreThanOneSnapshotPerTestFileRun: false,
     preprocessors: { 'package.json': [Function] },
     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: false,
     extensions: {},
     reportUnhandledPromises: true,
     slowTestThreshold: 75,
     lowCoverageThreshold: 80,
     loose: true,
     configCode:
      'module.exports = function (wallaby) {\r\n  return {\r\n    files: [\r\n      \'src/**/*.js?(x)\',\r\n      \'!src/**/*.spec.js?(x)\'\r\n    ],\r\n    tests: [\r\n      \'src/**/*.spec.js?(x)\'\r\n    ],\r\n\r\n    env: {\r\n      type: \'node\',\r\n      runner: \'node\'\r\n    },\r\n\r\n    compilers: {\r\n      "**/*.js?(x)": wallaby.compilers.babel()\r\n    },\r\n\r\n    testFramework: \'jest\',\r\n\r\n    debug: true\r\n  };\r\n};' },
  packageJSON: { dependencies: { jest: '*', react: '^15.4.2', 'react-test-renderer': '^15.4.2' }, devDependencies: { '@babel/core': '^7.2.2', '@babel/preset-env': '^7.3.1', '@babel/preset-react': '^7.0.0' } },
  fs: { numberOfFiles: 4 },
  debug:
   [ '2020-05-29T17:57:03.987Z project Wallaby Node version: v10.14.1\n',
     '2020-05-29T17:57:03.987Z project Wallaby config: REDACTED2\\wallaby-jest-snapshots\\wallaby.js\n',
     '2020-05-29T17:57:04.860Z project File cache: REDACTED\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.205\\projects\\6310841a1aebbd18\n',
     '2020-05-29T17:57:04.966Z uiService Listening port 51237\n',
     '2020-05-29T17:57:05.008Z project package.json file change detected, invalidating local cache\n',
     '2020-05-29T17:57:05.021Z workers Parallelism for initial run: 14, for regular run: 7\n',
     '2020-05-29T17:57:05.021Z workers Starting run worker instance #0\n',
     '2020-05-29T17:57:05.021Z workers Starting run worker instance #1\n',
     '2020-05-29T17:57:05.022Z workers Starting run worker instance #2\n',
     '2020-05-29T17:57:05.022Z workers Starting run worker instance #3\n',
     '2020-05-29T17:57:05.022Z workers Starting run worker instance #4\n',
     '2020-05-29T17:57:05.022Z workers Starting run worker instance #5\n',
     '2020-05-29T17:57:05.022Z workers Starting run worker instance #6\n',
     '2020-05-29T17:57:05.022Z workers Starting run worker instance #7\n',
     '2020-05-29T17:57:05.022Z workers Starting run worker instance #8\n',
     '2020-05-29T17:57:05.022Z workers Starting run worker instance #9\n',
     '2020-05-29T17:57:05.022Z workers Starting run worker instance #10\n',
     '2020-05-29T17:57:05.022Z workers Starting run worker instance #11\n',
     '2020-05-29T17:57:05.022Z workers Starting run worker instance #12\n',
     '2020-05-29T17:57:05.022Z workers Starting run worker instance #13\n',
     '2020-05-29T17:57:05.025Z workers Web server is listening at 56879\n',
     '2020-05-29T17:57:05.025Z project File cache requires some updates, waiting required files from IDE\n',
     '2020-05-29T17:57:05.160Z extended-core New document or complex document change\n',
     '2020-05-29T17:57:06.403Z workers Started run worker instance (delayed) #8\n',
     '2020-05-29T17:57:06.405Z workers Started run worker instance (delayed) #2\n',
     '2020-05-29T17:57:06.441Z workers Started run worker instance (delayed) #0\n',
     '2020-05-29T17:57:06.454Z workers Started run worker instance (delayed) #4\n',
     '2020-05-29T17:57:06.638Z workers Started run worker instance (delayed) #9\n',
     '2020-05-29T17:57:06.668Z workers Started run worker instance (delayed) #10\n',
     '2020-05-29T17:57:06.792Z workers Started run worker instance (delayed) #5\n',
     '2020-05-29T17:57:06.821Z workers Started run worker instance (delayed) #12\n',
     '2020-05-29T17:57:06.822Z workers Started run worker instance (delayed) #3\n',
     '2020-05-29T17:57:06.823Z workers Started run worker instance (delayed) #13\n',
     '2020-05-29T17:57:06.825Z workers Started run worker instance (delayed) #6\n',
     '2020-05-29T17:57:06.853Z workers Started run worker instance (delayed) #1\n',
     '2020-05-29T17:57:06.857Z workers Started run worker instance (delayed) #7\n',
     '2020-05-29T17:57:06.872Z workers Started run worker instance (delayed) #11\n',
     '2020-05-29T17:57:09.813Z project Stopping process pool\n',
     '2020-05-29T17:57:09.816Z project Running postprocessor\n',
     '2020-05-29T17:57:09.820Z postprocessor New TypeScript language service is required\n',
     '2020-05-29T17:57:09.821Z postprocessor TypeScript postprocessor will be removed because in 4 project files none were found by patterns: **/*.ts?(x)\n',
     '2020-05-29T17:57:09.821Z project Postprocessor execution finished\n',
     '2020-05-29T17:57:09.821Z project Postprocessor is removed as requested by itself\n',
     '2020-05-29T17:57:09.822Z project Test run started; run priority: 3\n',
     '2020-05-29T17:57:09.822Z project Running all tests\n',
     '2020-05-29T17:57:09.824Z workers Starting test run, priority: 3\n',
     '2020-05-29T17:57:09.824Z nodeRunner Starting sandbox [worker #0, session #9p1f1]\n',
     '2020-05-29T17:57:09.825Z nodeRunner Preparing sandbox [worker #0, session #9p1f1]\n',
     '2020-05-29T17:57:09.825Z nodeRunner Prepared sandbox [worker #0, session #9p1f1]\n',
     '2020-05-29T17:57:09.825Z workers [worker #0, session #9p1f1] Running tests in sandbox\n',
     '2020-05-29T17:57:14.492Z workers Sandbox (active) [9p1f1] error: ReferenceError: jasmine is not defined\n',
     '2020-05-29T17:57:14.493Z workers Failed to map the stack to user code, entry message: ReferenceError: jasmine is not defined, stack: ReferenceError: jasmine is not defined\n    at Object.<anonymous> (REDACTED\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.205\\wallaby\\runners\\node\\[email protected]\\jasmine2Initializer.js:14:29)\n    at Runtime._execModule (REDACTED2\\wallaby-jest-snapshots\\node_modules\\jest-runtime\\build\\index.js:1204:24)\n    at Runtime._loadModule (REDACTED2\\wallaby-jest-snapshots\\node_modules\\jest-runtime\\build\\index.js:815:12)\n    at Runtime.requireModule (REDACTED2\\wallaby-jest-snapshots\\node_modules\\jest-runtime\\build\\index.js:676:10)\n    at Runtime.d._wallabyReplaced.c.requireModule (REDACTED\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.205\\wallaby\\runners\\node\\[email protected]\\initializer.js:14:28526)\n    at jasmine2 (REDACTED2\\wallaby-jest-snapshots\\node_modules\\jest-jasmine2\\build\\index.js:204:15)\n    at runTestInternal (REDACTED2\\wallaby-jest-snapsh\n',
     '2020-05-29T17:57:14.497Z workers [9p1f1] Run 0 test(s), skipped 0 test(s)\n',
     '2020-05-29T17:57:14.498Z workers [9p1f1] Sandbox is responsive, closing it\n',
     '2020-05-29T17:57:14.499Z project Test run finished\n',
     '2020-05-29T17:57:14.500Z project Processed console.log entries\n',
     '2020-05-29T17:57:14.500Z project Processed loading sequences\n',
     '2020-05-29T17:57:14.500Z project Processed executed tests\n',
     '2020-05-29T17:57:14.500Z project Processed code coverage\n',
     '2020-05-29T17:57:14.505Z project Test run result processed and sent to IDE\n' ] }

in another project of mine I am getting

[Info]  Started Wallaby.js Core v1.0.900
[Info]  console.log: Jest: FAIL src/service.test.js
[Info]  console.log: Jest:   ● Test suite failed to run
[Info]      ReferenceError: jasmine is not defined
[Info]        at Object.<anonymous> (../../../../.vscode/extensions/wallabyjs.wallaby-vscode-1.0.205/wallaby/runners/node/[email protected]/jasmineInitializer.js:14:29)
[Error] Runtime error: ReferenceError: jasmine is not defined 
[Error]     at Runtime._execModule (.\node_modules\jest-runtime\build\index.js:1204:24) 
[Error]     at Runtime._loadModule (.\node_modules\jest-runtime\build\index.js:815:12) 
[Error]     at Runtime.requireModule (.\node_modules\jest-runtime\build\index.js:676:10) 
[Error]     at jasmine2 (.\node_modules\jest-jasmine2\build\index.js:204:15) 
[Error]     at runTestInternal (.\node_modules\jest-runner\build\runTest.js:374:22)

Thanks.

@ioandev
Copy link
Author

ioandev commented May 29, 2020

It might be an issue with my node version. I'm in the processor of installing the latest version (instead of LTS) now

@ioandev
Copy link
Author

ioandev commented May 29, 2020

Indeed, this was the issue. Is there a way to set the desired jest runner version wallaby-vscode is using? being forced to use a non-LTS version seems to be a big requirement.

@smcenlly
Copy link
Member

Could you please provide details of which node version you were using? We have tried our project on LTS and non-LTS and everything is working for us. The versions of node that we tried were:

  • 14.3.0
  • 13.13.0
  • 12.17.0
  • 11.0.0
  • 10.16.3

@ioandev
Copy link
Author

ioandev commented May 30, 2020

I was using 10.14.1

@ArtemGovorov
Copy link
Member

Can you please try if node v10.16.3 if working for you?

@ioandev
Copy link
Author

ioandev commented May 31, 2020

I am unable to try again as the newer version has overriden the previous one. Thanks for your help.

@ioandev ioandev closed this as completed May 31, 2020
@eric-dixon
Copy link

I am having the same issue with a newer version of node installed.
ReferenceError: jasmine is not defined 
at Runtime._execModule (./node_modules/jest-runtime/build/index.js:1299:24) 
at Runtime._loadModule (./node_modules/jest-runtime/build/index.js:898:12) 
at Runtime.requireModule (./node_modules/jest-runtime/build/index.js:746:10) 
at jestAdapter (./node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:93:15) 
at processTicksAndRejections (internal/process/task_queues.js:97:5) 
at runTestInternal (./node_modules/jest-runner/build/runTest.js:380:16) 
at runTest (./node_modules/jest-runner/build/runTest.js:472:34) 

{
  editorVersion: '1.51.1',
  pluginVersion: '1.0.251',
  editorType: 'VSCode',
  osVersion: 'darwin 19.6.0',
  nodeVersion: 'v12.18.3',
  coreVersion: '1.0.975',
  checksum: 'NzE0YjUyZGJhYzYzY2Y1YmUzZGEyOWVjZmI0ODQwYjcsMTYwMjg5MjgwMDAwMCww',
  config: {
    files: [
      { pattern: 'src/setupTests.ts', instrument: false, ignore: false, trigger: true, load: true, order: 1 },
      { pattern: 'src/**/*.+(ts|tsx|jsx|json|snap|css|less|sass|scss|jpg|jpeg|gif|png|svg)', ignore: false, trigger: true, load: true, instrument: true, order: 2 },
      { pattern: 'src/**/*.test.ts?(x)', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'src/**/*.test.ts?(x).snap', ignore: false, instrument: false, trigger: true, load: true, order: 3 },
      { pattern: 'package.json', ignore: false, instrument: false, trigger: true, load: true, order: 4 }
    ],
    tests: [ { pattern: 'src/**/*.test.ts?(x)', ignore: false, trigger: true, load: true, test: true, order: 5 } ],
    env: {
      type: 'node',
      params: {},
      runner: '<homeDir>/.nvm/versions/node/v12.18.3/bin/node',
      viewportSize: { width: 800, height: 600 },
      options: { width: 800, height: 600 },
      bundle: true
    },
    preprocessors: { '**/*.js?(x)': [Function: **/*.js?(x)], 'package.json': [Function] },
    testFramework: { version: '[email protected]', configurator: '[email protected]', reporter: '[email protected]', starter: '[email protected]' },
    diagnostics: {},
    filesWithNoCoverageCalculated: [],
    runAllTestsInAffectedTestFile: false,
    updateNoMoreThanOneSnapshotPerTestFileRun: false,
    compilers: { '**/*.?(lit)coffee?(.md)': [Function] },
    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: false,
    extensions: {},
    reportUnhandledPromises: true,
    slowTestThreshold: 75,
    lowCoverageThreshold: 80,
    loose: true,
    configCode: 'module.exports = function (wallaby) {\n' +
      '\tvar path = require("path");\n' +
      '\tprocess.env.BABEL_ENV = "test";\n' +
      '\tprocess.env.NODE_ENV = "test";\n' +
      '\tprocess.env.NODE_PATH +=\n' +
      '\t\tpath.delimiter + path.join(__dirname, "node_modules") + path.delimiter + path.join(__dirname, "node_modules/react-scripts/node_modules");\n' +
      '\trequire("module").Module._initPaths();\n' +
      '\n' +
      '\treturn {\n' +
      '\t\tfiles: [\n' +
      '\t\t\t{ pattern: "src/setupTests.ts", instrument: false },\n' +
      '\t\t\t"src/**/*.+(ts|tsx|jsx|json|snap|css|less|sass|scss|jpg|jpeg|gif|png|svg)",\n' +
      '\t\t\t"!src/**/*.test.ts?(x)",\n' +
      '\t\t],\n' +
      '\n' +
      '\t\ttests: ["src/**/*.test.ts?(x)"],\n' +
      '\n' +
      '\t\tenv: {\n' +
      '\t\t\ttype: "node",\n' +
      '\t\t},\n' +
      '\n' +
      '\t\tpreprocessors: {\n' +
      '\t\t\t"**/*.js?(x)": (file) =>\n' +
      '\t\t\t\trequire("@babel/core").transform(file.content, {\n' +
      '\t\t\t\t\tsourceMap: true,\n' +
      '\t\t\t\t\tcompact: false,\n' +
      '\t\t\t\t\tfilename: file.path,\n' +
      '\t\t\t\t\tpresets: [require("babel-preset-jest"), "react-app"],\n' +
      '\t\t\t\t}),\n' +
      '\t\t},\n' +
      '\n' +
      '\t\tsetup: (wallaby) => {\n' +
      '\t\t\tconst jestConfig = require("react-scripts/scripts/utils/createJestConfig")((p) => require.resolve("react-scripts/" + p));\n' +
      '\t\t\tObject.keys(jestConfig.transform || {}).forEach((k) => ~k.indexOf("^.+\\\\.(js|jsx") && void delete jestConfig.transform[k]);\n' +
      '\t\t\tdelete jestConfig.testEnvironment;\n' +
      '\t\t\twallaby.testFramework.configure(jestConfig);\n' +
      '\t\t},\n' +
      '\n' +
      '\t\ttestFramework: "jest",\n' +
      '\t};\n' +
      '};\n'
  },
  packageJSON: {
    dependencies: {
      '@craco/craco': '^5.8.0',
      '@testing-library/jest-dom': '^5.11.6',
      '@testing-library/react': '^11.2.0',
      '@testing-library/user-event': '^12.2.2',
      '@types/jest': '^26.0.15',
      '@types/node': '^12.19.5',
      '@types/react': '^16.9.56',
      '@types/react-dom': '^16.9.9',
      '@types/react-router-dom': '^5.1.6',
      antd: '^4.8.0',
      axios: '^0.21.0',
      'craco-less': '^1.17.0',
      lodash: '^4.17.20',
      'node-sass': '^4.14.1',
      react: '^17.0.1',
      'react-dom': '^17.0.1',
      'react-router-dom': '^5.2.0',
      'react-scripts': '4.0.0',
      typescript: '^4.0.5',
      'web-vitals': '^0.2.4'
    },
    devDependencies: {
      '@typescript-eslint/eslint-plugin': '^4.8.1',
      '@typescript-eslint/parser': '^4.8.1',
      'antd-scss-theme-plugin': '^1.0.8',
      eslint: '^7.2.0',
      'eslint-config-airbnb': '^18.2.1',
      'eslint-config-airbnb-typescript': '^12.0.0',
      'eslint-config-prettier': '^6.15.0',
      'eslint-plugin-import': '^2.22.1',
      'eslint-plugin-jest': '^24.1.3',
      'eslint-plugin-jsx-a11y': '^6.4.1',
      'eslint-plugin-prettier': '^3.1.4',
      'eslint-plugin-react': '^7.21.5',
      'eslint-plugin-react-hooks': '^4.0.0',
      prettier: '^2.1.2',
      'sass-loader': '^10.1.0',
      tailwindcss: '^1.9.6'
    }
  },
  fs: { numberOfFiles: 13 },
  debug: [
    '2020-11-19T22:46:13.155Z project Wallaby Node version: v12.18.3\n',
    '2020-11-19T22:46:13.155Z project Wallaby config: <homeDir>/Documents/projects/sappiEcomm/sappi-ecomm-react/wallaby.js\n',
    '2020-11-19T22:46:13.911Z project File cache: <homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.251/projects/3537743b8aeee552\n',
    '2020-11-19T22:46:13.925Z uiService Listening port 51235\n',
    '2020-11-19T22:46:13.937Z workers Parallelism for initial run: 6, for regular run: 3\n',
    '2020-11-19T22:46:13.937Z workers Starting run worker instance #0\n',
    '2020-11-19T22:46:13.937Z workers Starting run worker instance #1\n',
    '2020-11-19T22:46:13.937Z workers Starting run worker instance #2\n',
    '2020-11-19T22:46:13.937Z workers Starting run worker instance #3\n',
    '2020-11-19T22:46:13.937Z workers Starting run worker instance #4\n',
    '2020-11-19T22:46:13.937Z workers Starting run worker instance #5\n',
    '2020-11-19T22:46:13.938Z workers Web server is listening at 62904\n',
    '2020-11-19T22:46:14.001Z project File cache requires some updates, waiting required files from IDE\n',
    '2020-11-19T22:46:14.541Z workers Started run worker instance (delayed) #1\n',
    '2020-11-19T22:46:14.815Z workers Started run worker instance (delayed) #0\n',
    '2020-11-19T22:46:14.928Z workers Started run worker instance (delayed) #3\n',
    '2020-11-19T22:46:14.952Z workers Started run worker instance (delayed) #2\n',
    '2020-11-19T22:46:15.017Z workers Started run worker instance (delayed) #5\n',
    '2020-11-19T22:46:15.066Z workers Started run worker instance (delayed) #4\n',
    '2020-11-19T22:46:15.289Z project Stopping process pool\n',
    '2020-11-19T22:46:15.292Z project Running postprocessor\n',
    '2020-11-19T22:46:15.296Z postprocessor New TypeScript language service is required\n',
    '2020-11-19T22:46:16.637Z project Postprocessor execution finished\n',
    '2020-11-19T22:46:16.637Z project Test run started; run priority: 3\n',
    '2020-11-19T22:46:16.637Z project Running all tests\n',
    '2020-11-19T22:46:16.639Z workers Starting test run, priority: 3\n',
    '2020-11-19T22:46:16.639Z nodeRunner Starting sandbox [worker #0, session #n18ws]\n',
    '2020-11-19T22:46:16.639Z nodeRunner Preparing sandbox [worker #0, session #n18ws]\n',
    '2020-11-19T22:46:16.639Z nodeRunner Prepared sandbox [worker #0, session #n18ws]\n',
    '2020-11-19T22:46:16.639Z workers [worker #0, session #n18ws] Running tests in sandbox\n',
    '2020-11-19T22:46:18.988Z workers Sandbox (active) [n18ws] error: ReferenceError: jasmine is not defined\n',
    '2020-11-19T22:46:18.990Z workers Failed to map the stack to user code, entry message: ReferenceError: jasmine is not defined, stack: ReferenceError: jasmine is not defined\n' +
      '    at Object.<anonymous> (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.251/wallaby73cdd4/runners/node/[email protected]/jasmineInitializer.js:14:33)\n' +
      '    at Runtime._execModule (<homeDir>/Documents/projects/sappiEcomm/sappi-ecomm-react/node_modules/jest-runtime/build/index.js:1299:24)\n' +
      '    at Runtime._loadModule (<homeDir>/Documents/projects/sappiEcomm/sappi-ecomm-react/node_modules/jest-runtime/build/index.js:898:12)\n' +
      '    at Runtime.requireModule (<homeDir>/Documents/projects/sappiEcomm/sappi-ecomm-react/node_modules/jest-runtime/build/index.js:746:10)\n' +
      '    at Runtime.p._wallabyReplaced.c.requireModule (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.251/wallaby73cdd4/runners/node/[email protected]/initializer.js:14:29085)\n' +
      '    at jestAdapter (<homeDir>/Documents/projects/sappiEcomm/sappi-ecomm-react/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:93:15)\n' +
      '    at processTicksAndRejections (internal/proc\n',
    '2020-11-19T22:46:18.995Z workers [n18ws] Run 0 test(s), skipped 0 test(s)\n',
    '2020-11-19T22:46:18.996Z workers [n18ws] Sandbox is responsive, closing it\n',
    '2020-11-19T22:46:18.997Z project Test run finished\n',
    '2020-11-19T22:46:18.997Z project Processed console.log entries\n',
    '2020-11-19T22:46:18.997Z project Processed loading sequences\n',
    '2020-11-19T22:46:18.997Z project Processed executed tests\n',
    '2020-11-19T22:46:18.998Z project Processed code coverage\n',
    '2020-11-19T22:46:19.003Z project Test run result processed and sent to IDE\n',
    '2020-11-19T22:46:21.988Z fs File changed: src/App.test.tsx\n',
    '2020-11-19T22:46:21.998Z project Running postprocessor\n',
    '2020-11-19T22:46:21.999Z testTask Test files from affected: 1, from deleted or manually requested: 0, from recently changed: 0, from loaded by: 0, from failing: 0\n',
    '2020-11-19T22:46:22.039Z project Postprocessor execution finished\n',
    '2020-11-19T22:46:22.039Z project Test run started; run priority: 2\n',
    '2020-11-19T22:46:22.040Z testTask Test files from affected: 1, from deleted or manually requested: 0, from recently changed: 0, from loaded by: 0, from failing: 0\n',
    '2020-11-19T22:46:22.041Z workers Starting test run, priority: 2\n',
    '2020-11-19T22:46:22.041Z nodeRunner Starting sandbox [worker #0, session #wsrkw]\n',
    '2020-11-19T22:46:22.041Z nodeRunner Preparing sandbox [worker #0, session #wsrkw]\n',
    '2020-11-19T22:46:22.041Z nodeRunner Prepared sandbox [worker #0, session #wsrkw]\n',
    '2020-11-19T22:46:22.041Z workers [worker #0, session #wsrkw] Running tests in sandbox\n',
    '2020-11-19T22:46:22.144Z workers Sandbox (active) [wsrkw] error: ReferenceError: jasmine is not defined\n',
    '2020-11-19T22:46:22.145Z workers Failed to map the stack to user code, entry message: ReferenceError: jasmine is not defined, stack: ReferenceError: jasmine is not defined\n' +
      '    at Object.<anonymous> (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.251/wallaby73cdd4/runners/node/[email protected]/jasmineInitializer.js:14:33)\n' +
      '    at Runtime._execModule (<homeDir>/Documents/projects/sappiEcomm/sappi-ecomm-react/node_modules/jest-runtime/build/index.js:1299:24)\n' +
      '    at Runtime._loadModule (<homeDir>/Documents/projects/sappiEcomm/sappi-ecomm-react/node_modules/jest-runtime/build/index.js:898:12)\n' +
      '    at Runtime.requireModule (<homeDir>/Documents/projects/sappiEcomm/sappi-ecomm-react/node_modules/jest-runtime/build/index.js:746:10)\n' +
      '    at Runtime.p._wallabyReplaced.c.requireModule (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.251/wallaby73cdd4/runners/node/[email protected]/initializer.js:14:29085)\n' +
      '    at jestAdapter (<homeDir>/Documents/projects/sappiEcomm/sappi-ecomm-react/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:93:15)\n' +
      '    at processTicksAndRejections (internal/proc\n',
    '2020-11-19T22:46:22.149Z workers [wsrkw] Run 0 test(s), skipped 0 test(s)\n',
    '2020-11-19T22:46:22.150Z workers [wsrkw] Sandbox is responsive, closing it\n',
    '2020-11-19T22:46:22.150Z project Test run finished\n',
    '2020-11-19T22:46:22.151Z project Processed console.log entries\n',
    '2020-11-19T22:46:22.151Z project Processed loading sequences\n',
    '2020-11-19T22:46:22.151Z project Processed executed tests\n',
    '2020-11-19T22:46:22.151Z project Processed code coverage\n',
    '2020-11-19T22:46:22.152Z project Test run result processed and sent to IDE\n'
  ]
}

@smcenlly
Copy link
Member

@eric-dixon - I can see from your diagnostic report that you are using Jest v26. Is there any reason that you are not using Wallaby's automatic configuration feature? This should work for you and should also fix your problem.

To use automatic configuration:

  1. Delete your configuration file
  2. Run the Wallaby.js: Select Configuration command and then select Automatic Configuration <project directory> option (you only need to do this once for your project).

After specifying to use automatic configuration, you may keep using the Wallaby.js: Start command as usual and it will start Wallaby with automatic configuration.

@eric-dixon
Copy link

I tried using automatic configuration, and I get the following error
‌[Error] Automatic Jest configuration error: Module jest-cli is not found in '.'. .
I used a config file as I noticed that there was a create react app typescript specific config file that was recommended in the docs : https://github.com/wallabyjs/wallaby-create-react-app-ts/blob/master/wallaby.js

@eric-dixon
Copy link

Ah, I see what the issue was for me. I guess it didn't like that I was in a directory above the root of my project(where the wallaby.js config file was). If I open VScode in the root directory of my project, it appears to work.

@ioandev
Copy link
Author

ioandev commented Nov 20, 2020

Wallaby uses the jest cli which is a dependency of your project and installs in node_modules. If you're in the parent of your project's folder then it's not going to find it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants