From 637e52580741f88752318f49b4bdcdac1d654ccc Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 8 Aug 2016 16:32:58 -0700 Subject: [PATCH] Use fake document & window in atom environment serialization spec --- spec/atom-environment-spec.coffee | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/spec/atom-environment-spec.coffee b/spec/atom-environment-spec.coffee index 937b2b241..fa8c3cc5d 100644 --- a/spec/atom-environment-spec.coffee +++ b/spec/atom-environment-spec.coffee @@ -268,7 +268,17 @@ describe "AtomEnvironment", -> runs -> atom.textEditors.setGrammarOverride(editor, 'text.plain') - atom2 = new AtomEnvironment(atom) + atom2 = new AtomEnvironment({ + applicationDelegate: atom.applicationDelegate, + window: document.createElement('div'), + document: Object.assign( + document.createElement('div'), + { + body: document.createElement('div'), + head: document.createElement('div'), + } + ) + }) atom2.deserialize(atom.serialize()) expect(atom2.textEditors.getGrammarOverride(editor)).toBe('text.plain')