mardi 25 octobre 2016

Ava babel-register not transpiling

I'm trying to include Ava (migrating from mocha) as my test runner for a react / electron app.

I've got this config in my package.json

  "ava": {
    "files": [
      "./app/**/*.spec.js"
    ],
    "source": [
      "./app/**/*.{js,jsx}"
    ],
    "concurrency": 5,
    "failFast": true,
    "require": [
      "babel-register",
      "ignore-styles",
      "./app/test/setup.js"
    ],
    "babel": {
      "presets": [
        "es2015",
        "react"
      ]
    }
  },

With my setup.js just being a helper to setup jsdom.

I keep getting an error:

(function (exports, require, module, __filename, __dirname) { import { jsdom } from 'jsdom';
                                                              ^^^^^^
SyntaxError: Unexpected token import

So it seems like babel-register isn't being required properly.

Aucun commentaire:

Enregistrer un commentaire