how to pass compiler options to mocha

后端 未结 3 770
执笔经年
执笔经年 2021-02-13 06:23

I run a mocha command to run my tests

$ ./node_modules/.bin/mocha --compilers coffee:coffee-script -R spec

I wish to pass additional options t

3条回答
  •  盖世英雄少女心
    2021-02-13 06:51

    In case anyone stumbles upon this. The 'experimental' option in babel has been deprecated. Your 'babelhook.js' should now read:

    // This file is required in mocha.opts
    // The only purpose of this file is to ensure
    // the babel transpiler is activated prior to any
    // test code, and using the same babel options
    
    require("babel/register")({
      stage: 1
    });
    

提交回复
热议问题