diff --git a/spec/stores/draft-store-spec.coffee b/spec/stores/draft-store-spec.coffee index 6efd19120..82a3c515a 100644 --- a/spec/stores/draft-store-spec.coffee +++ b/spec/stores/draft-store-spec.coffee @@ -32,6 +32,10 @@ class TestExtension extends DraftStoreExtension describe "DraftStore", -> beforeEach -> spyOn(atom, 'newWindow').andCallFake -> + for id, session of DraftStore._draftSessions + if session.teardown + DraftStore._doneWithSession(session) + DraftStore._draftSessions = {} describe "creating drafts", -> beforeEach -> diff --git a/src/atom.coffee b/src/atom.coffee index 48da4e69f..bcb087232 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -61,7 +61,7 @@ class Atom extends Model @getStatePath: -> {isSpec, mainWindow} = @getLoadSettings() if isSpec - filename = 'spec' + filename = 'spec-saved-state.json' else if mainWindow path.join(@getConfigDirPath(), 'main-window-state.json') else diff --git a/src/flux/nylas-api.coffee b/src/flux/nylas-api.coffee index ff03807d5..973d177f9 100644 --- a/src/flux/nylas-api.coffee +++ b/src/flux/nylas-api.coffee @@ -128,7 +128,11 @@ class NylasAPI _onConfigChanged: => prev = {@AppID, @APIRoot, @APITokens} - env = atom.config.get('env') + if atom.inSpecMode() + env = "testing" + else + env = atom.config.get('env') + if not env env = 'production' console.error("NylasAPI: config.cson does not contain an environment \