Skip to content

Commit

Permalink
💚 Fix random failures in tests due to setup
Browse files Browse the repository at this point in the history
  • Loading branch information
abe33 committed Dec 16, 2014
1 parent badc696 commit da7fd15
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions spec/minimap-v4-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@
Minimap = require '../lib/minimap'

describe 'Minimap package v4', ->
[workspaceElement, minimapPackage] = []
[editor, minimap, editorElement, minimapElement, workspaceElement, minimapPackage] = []

beforeEach ->
atom.config.set 'minimap.v4Preview', true

workspaceElement = atom.views.getView(atom.workspace)

waitsFor ->
atom.workspace.open('sample.coffee')

waitsFor -> atom.packages.activatePackage('minimap')

waitsFor -> workspaceElement.querySelector('atom-text-editor')
runs ->
editor = atom.workspace.getActiveTextEditor()
editorElement = atom.views.getView(editor)
minimapPackage = atom.packages.getLoadedPackage('minimap').mainModule

afterEach ->
Expand All @@ -29,22 +37,6 @@ describe 'Minimap package v4', ->
expect(minimapElement).toExist()

describe 'when an editor is opened', ->
[editor, minimap, editorElement, minimapElement] = []

beforeEach ->
waitsFor ->
atom.workspace.open('sample.coffee')

runs ->
workspaceElement = atom.views.getView(atom.workspace)
jasmine.attachToDOM(workspaceElement)

waitsFor -> atom.workspace.getActiveTextEditor()

runs ->
editor = atom.workspace.getActiveTextEditor()
editorElement = atom.views.getView(editor)

it 'creates a minimap model for the editor', ->
expect(minimapPackage.minimapForEditor(editor)).toBeDefined()

Expand Down

0 comments on commit da7fd15

Please sign in to comment.