Skip to content

Can't use this configuration with JestΒ #1

@davegomez

Description

@davegomez

I've been trying to use this Nextjs config to create the github page for my library and also I'm using Jest as a test runner but I have found that if I change my .babelrc file to use it as a JavaScript file instead of JSON it seems Jest doesn't recognize the file and can't use Babel for my tests.

The Jest config I need is as simple as this:

{
  "presets": [
    "env",
    "react"
  ]
}

And the config I mage to use with this Nextjs example is this:

const env = require('./env-config')

module.exports = {
  presets: ['env', 'react', 'next/babel'],
  plugins: [['transform-define', env]],
}

Any idea how can I keep the JSON .babelrc and use your example at the same time or is it possible to use a babelrc.js file with Jest? I haven't found a way to do it πŸ˜”

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions