mardi 5 février 2019

Jest with graphql, "Plugin/Preset files are not allowed to export objects, only functions"

I'm trying to write some tests with JEST and graphql but am getting the following error no matter what I have in my .test.js files (even when having no code at all in it).

Plugin/Preset files are not allowed to export objects, only functions. In /Users/oscarstein/Documents/Projekt/Biljettsystem/ticketgo/system/node_modules/babel-preset-stage-2/lib/index.js

My .babelrc file looks as follows:

{
    "presets": ["env", "stage-2"]
   }

So the error comes from me using the preset "stage-2" and when i remove it everything works fine with the tests. But since my application is built with stage-2 I was wondering if there is any workaround using both "stage-2" and getting the JEST tests to work?

Aucun commentaire:

Enregistrer un commentaire