diff --git a/test/base/tojs.js b/test/base/tojs.js index b6b8d3c25..9f324a525 100644 --- a/test/base/tojs.js +++ b/test/base/tojs.js @@ -403,4 +403,9 @@ describe("recurseEverything set to true", function() { const convertedObj = mobx.toJS({ key: cycledObj }, { recurseEverything: true }) expect(convertedObj.key).toBe(convertedObj.key.cycle) }) + + test("should return null if source is null", function() { + expect(mobx.toJS(null)).toBeNull() + expect(mobx.toJS(null, { recurseEverything: true })).toBeNull() + }) })