ReferenceError: [BABEL] /home/sriram/Desktop/gooodbet/client/scripts/test.js: Unknown option: /node_modules/babel-preset-react-app/index.js.overrides

Viewed 509

I am getting the below error while running npm test using jest . I have express app inside which there is client folder which is a create-react-app-2 and when I ejected it the problem is showing up . what to do now ??

Test suite failed to run

    ReferenceError: [BABEL] /home/sriram/Desktop/gooodbet/client/scripts/test.js: Unknown option: /home/sriram/Desktop/gooodbet/client/node_modules/babel-preset-react-app/index.js.overrides. Check out http://babeljs.io/docs/usage/options/ for more information about options.

    A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:

    Invalid:
      `{ presets: [{option: value}] }`
    Valid:
      `{ presets: [['presetName', {option: value}]] }`

    For more detailed information on preset configuration, please see https://babeljs.io/docs/en/plugins#pluginpresets-options. (While processing preset: "/home/sriram/Desktop/gooodbet/client/node_modules/babel-preset-react-app/index.js")

      at Logger.error (node_modules/babel-core/lib/transformation/file/logger.js:41:11)
      at OptionManager.mergeOptions (node_modules/babel-core/lib/transformation/file/options/option-manager.js:226:20)
      at node_modules/babel-core/lib/transformation/file/options/option-manager.js:265:14
      at node_modules/babel-core/lib/transformation/file/options/option-manager.js:323:22
          at Array.map (<anonymous>)
      at OptionManager.resolvePresets (node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
      at OptionManager.mergePresets (node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
      at OptionManager.mergeOptions (node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
      at OptionManager.init (node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
      at File.initOptions (node_modules/babel-core/lib/transformation/file/index.js:212:65)


 RUNS  tests/integration/localAuth.test.js
 FAIL  tests/integration/localAuth.test.js
  localAuth
    POST /api/signup
      ✓ should signup successfully (536ms)
      ✕ should send 400 for not having email (8ms)

  ● localAuth › POST /api/signup › should send 400 for not having email

    Bad Request

      at Test.Object.<anonymous>.Request.callback (node_modules/superagent/lib/node/index.js:804:15)
      at IncomingMessage.parser (node_modules/superagent/lib/node/index.js:1036:18)

Test Suites: 2 failed, 2 total
Tests:       1 failed, 1 passed, 2 total
Snapshots:   0 total
Time:        2.378s
Ran all test suites.
1 Answers

I followed this link to

and undo eject of create-react-app and everything works now

Related