1
0
Fork 0

more lint fixes

This commit is contained in:
Enoch Riese 2022-11-15 17:29:02 -06:00
parent dbc0ed53a1
commit 341a5cce61
2 changed files with 11 additions and 2 deletions

View file

@ -91,6 +91,7 @@ module.exports = {
],
env: {
mocha: true,
node: true,
},
},

View file

@ -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)
}