diff --git a/.eslintrc.cjs b/.eslintrc.cjs index b5efa690bda..7bcd78572f7 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -91,6 +91,7 @@ module.exports = { ], env: { mocha: true, + node: true, }, }, diff --git a/packages/core/tests/path.test.mjs b/packages/core/tests/path.test.mjs index 4e0b986e0ce..7468a8c736a 100644 --- a/packages/core/tests/path.test.mjs +++ b/packages/core/tests/path.test.mjs @@ -1009,9 +1009,17 @@ describe('Path', () => { it('Should log an error when splitting a path on a non-point', () => { let invalid = false const log = { error: () => (invalid = true) } + const pointLog = { warning: () => {} } try { - const a = new Path().__withLog(log).move(new Point(0, 0)).line(new Point(0, 40)).split() - } catch { + new Path() + .__withLog(log) + .move(new Point(0, 0).__withLog(pointLog)) + .line(new Point(0, 40).__withLog(pointLog)) + .split() + } catch (e) { + expect(e.toString()).to.include( + "TypeError: Cannot read properties of undefined (reading '__check')" + ) } finally { expect(invalid).to.equal(true) }