AVA 测试设置:"Unexpected token export"

AVA test setup: "Unexpected token export"

问题

我正在尝试将 AVA 测试添加到项目中,但我的测试无法使用我的 Babel 设置正确解析 ES2015 模块。对我来说奇怪的是 imports 工作正常,如果我 运行 我的 npm run build 和 运行 REPL 的输出它工作......所以看起来AVA 没有正确转译 export 语句,或者我的 package.json 中的配置有问题?我尝试通读文档并查看其他示例,但均未成功。

重现步骤

  1. 克隆https://github.com/trevordmiller/utility-functions
  2. checkout tests 分支
  3. npm install
  4. npm test

报错(下图)- ES2015 模块 export 错误 getURLSlug 第 7 行:

将 "require": ["babel-register"] 添加到 package.json

中的 AVA 配置