fix(specs): specs run clean

This commit is contained in:
Evan Morikawa 2015-10-02 18:43:58 -07:00
parent 48cddbbbe6
commit 3d20e272ee
3 changed files with 10 additions and 2 deletions

View file

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

View file

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

View file

@ -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 \