rewire icon indicating copy to clipboard operation
rewire copied to clipboard

How to use rewire test closure function?

Open sunfeng90 opened this issue 7 years ago • 3 comments

Hi, how to test closure function ? The closure function don't export.

sunfeng90 avatar May 03 '17 02:05 sunfeng90

The closure like as:

module.exports = function(CheckCode) {
     var sum = (a, b) => {
           return a + b;
     }
     ....
};

sunfeng90 avatar May 03 '17 02:05 sunfeng90

This is not supported by rewire. See the limitations section in the readme. I don't think it is possible to overcome this limitation.

JvJefke avatar Nov 15 '17 20:11 JvJefke

Thanks

sunfeng90 avatar Nov 16 '17 03:11 sunfeng90