Skip to content

Commit a306b98

Browse files
committed
add test
1 parent eab3761 commit a306b98

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/test.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,21 @@ for (const fn of [uneval, stringify]) {
560560
assert.equal(e.path, '.foo.map.get("key")');
561561
}
562562
});
563+
564+
uvu.test(`${fn.name} populates error.path after maps (#64)`, () => {
565+
try {
566+
fn({
567+
map: new Map([['key', 'value']]),
568+
object: {
569+
invalid() {}
570+
}
571+
});
572+
} catch (e) {
573+
assert.equal(e.name, 'DevalueError');
574+
assert.equal(e.message, 'Cannot stringify a function');
575+
assert.equal(e.path, '.object.invalid');
576+
}
577+
});
563578
}
564579

565580
uvu.test('does not create duplicate parameter names', () => {

0 commit comments

Comments
 (0)