Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Apr 19, 2024
1 parent eab3761 commit a306b98
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,21 @@ for (const fn of [uneval, stringify]) {
assert.equal(e.path, '.foo.map.get("key")');
}
});

uvu.test(`${fn.name} populates error.path after maps (#64)`, () => {
try {
fn({
map: new Map([['key', 'value']]),
object: {
invalid() {}
}
});
} catch (e) {
assert.equal(e.name, 'DevalueError');
assert.equal(e.message, 'Cannot stringify a function');
assert.equal(e.path, '.object.invalid');
}
});
}

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

0 comments on commit a306b98

Please sign in to comment.