From 341a5cce61fd75e229f3c161b5884c11eca90cb3 Mon Sep 17 00:00:00 2001 From: Enoch Riese Date: Tue, 15 Nov 2022 17:29:02 -0600 Subject: [PATCH] more lint fixes --- .eslintrc.cjs | 1 + packages/core/tests/path.test.mjs | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) 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) }