阅读背景:

使用Node.js的require.extensions更好的方法

来源:互联网 

I'm testing a bunch of React JSX components. They all need to be transpiled with React, or Babel or whatever, but we have special needs for stubbing requirements, so I'm trying to override requires with a special compiler that's run with Mocha. The solution below works well, but you'll notice that we're using require.extensions[] to capture all the .jsx files. What concerns me is that require.extensions is locked and deprecated. Is there any better way to do this?I'm testing a bunch of React JSX components. Th




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: