1 | const { expect } = require('chai');
|
2 |
|
3 | exports.itWrapperCreator = function (fnName, fn) {
|
4 | return function (args, expected) {
|
5 | const serializedArgs = JSON.stringify(args).replace(/(\[|\])/g, '').replace(',', ', ');
|
6 | return it(
|
7 | `${fnName}(${serializedArgs}) => ${expected}`,
|
8 | () => expect(fn(...args)).to.equal(expected),
|
9 | );
|
10 | };
|
11 | };
|