techfort / LokiJS

javascript embeddable / in-memory database
http:/techfort.github.io/LokiJS
MIT License
6.74k stars 482 forks source link

Incorrect implementation of unit test of `immutable` #919

Open Losses opened 1 year ago

Losses commented 1 year ago

https://github.com/techfort/LokiJS/blob/25b9a33d57509717d43b4da06d92064f2b7a6c95/spec/generic/immutable.spec.js#L267

The code (probably) should be:

expect(isFrozen(docs[0]) && isFrozen(docs[1])).toBe(true)

but not:

expect(isFrozen(docs[0] && isFrozen(docs[1]))).toBe(true)

Same issue:

https://github.com/techfort/LokiJS/blob/25b9a33d57509717d43b4da06d92064f2b7a6c95/spec/generic/immutable.spec.js#L272