Node v13 / Jest / ES6 — native support for modules without babel or esm

前端 未结 4 1435
心在旅途
心在旅途 2020-12-11 00:47

Is it possible to test ES6 Modules with Jest without esm or babel? Since node v13 supports es6 natively have tried:

//         


        
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-11 01:15

    Note that this is is still experimental, but we have documented how to test this, so there's hopefully less confusion.

    https://jestjs.io/docs/en/ecmascript-modules

    The steps in https://stackoverflow.com/a/61653104/1850276 are correct

提交回复
热议问题