Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function factory (parserName, parseFn) {
forIn(actuals, (values, key) => {
values.forEach((code, i) => {
const actual = parseFn(code)
const expect = expected[key][i]
const value = actual.value.replace(/^\(\{? ?/, '').replace(/\)$/, '')
test(`#${testsCount++} - ${parserName} - ${value}`, (done) => {
test.strictEqual(actual.isValid, true)
test.strictEqual(actual.name, expect.name)
test.strictEqual(actual.body, expect.body)
test.strictEqual(actual.params, expect.params)
test.deepEqual(actual.args, expect.args)
test.deepEqual(actual.defaults, expect.defaults)
test.ok(actual.value)
done()
})
})