私はCustomer.js.flow
タイプのファイルを持っています。私は明示的に追加場合でも非js | .jsx拡張子を変換するためのbabel-jest
Customer.js.flow:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){export type Customer = {
^^^^^^
SyntaxError: Unexpected token export
at transformAndBuildScript (node_modules/jest-runtime/build/transform.js:320:12)
:
私は冗談を実行すると、このエラーで失敗し
"transform": {
"^.+\\.js.flow$": "babel-jest",
"^.+\\.jsx?$": "babel-jest"
},
を、私はCustomer.js
にCustomer.js.flow
を変更したときに、私はもう問題はありません
私の質問が更新されました。私は解決策はここにあります:https://github.com/facebook/jest/issues/2152#issuecomment-262485964 私は自分のカスタムトランスフォーマーをここに書いています:https://github.com/MayasHaddad/flow-jest -トランス – Mayas