avajs / babel

Babel provider for AVA.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`SyntaxError: Unexpected token '<'` with JSX in AVA 3

fregante opened this issue · comments

The docs mention the stage preset:

				"presets": ["@babel/preset-stage-3"]

Babel presets have been deprecated since 2018 so I get:

Error: [BABEL] ./tests/index.js: 
  As of v7.0.0-beta.55, we've removed Babel's Stage presets.
  Please consider reading our blog post on this decision at
  https://babeljs.io/blog/2018/07/27/removing-babels-stage-presets
  for more details. TL;DR is that it's more beneficial in the
    long run to explicitly add which proposals to use.

Also I'm having trouble supporting JSX in test files with the suggested configuration:

ava

  ✖ No tests found in tests/index.js

  ─

  Uncaught exception in tests/index.js

  SyntaxError: Unexpected token '<'

  › Loader.moduleStrategy (internal/modules/esm/translators.js:88:18)
  › link (internal/modules/esm/module_job.js:41:21)

  ─

  1 uncaught exception