Remove use of OpenSync from specs

This commit is contained in:
Corey Johnson 2014-04-24 14:14:10 -07:00
parent 5193e6e46b
commit c7e308bca0
2 changed files with 14 additions and 7 deletions

View File

@ -2,7 +2,7 @@
ReactEditorView = require '../src/react-editor-view'
nbsp = String.fromCharCode(160)
describe "EditorComponent", ->
fdescribe "EditorComponent", ->
[editor, wrapperView, component, node, verticalScrollbarNode, horizontalScrollbarNode] = []
[lineHeightInPixels, charWidth, delayAnimationFrames, nextAnimationFrame] = []
@ -22,7 +22,10 @@ describe "EditorComponent", ->
else
fn()
editor = atom.project.openSync('sample.js')
waitsForPromise ->
atom.project.open('sample.js').then (o) -> editor = o
runs ->
wrapperView = new ReactEditorView(editor)
wrapperView.attachToDom()
{component} = wrapperView

View File

@ -6,7 +6,7 @@ describe "TokenizedLine", ->
describe "::getScopeTree()", ->
it "returns a tree whose inner nodes are scopes and whose leaf nodes are tokens in those scopes", ->
editor = atom.project.openSync('coffee.coffee')
editor = null
ensureValidScopeTree = (scopeTree, scopes=[]) ->
if scopeTree.children?
@ -16,7 +16,11 @@ describe "TokenizedLine", ->
expect(scopeTree).toBe tokens[tokenIndex++]
expect(scopes).toEqual scopeTree.scopes
tokenIndex = 0
tokens = editor.lineForScreenRow(1).tokens
scopeTree = editor.lineForScreenRow(1).getScopeTree()
ensureValidScopeTree(scopeTree)
waitsForPromise ->
atom.project.open('coffee.coffee').then (o) -> editor = o
runs ->
tokenIndex = 0
tokens = editor.lineForScreenRow(1).tokens
scopeTree = editor.lineForScreenRow(1).getScopeTree()
ensureValidScopeTree(scopeTree)