mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-21 07:58:04 +03:00
Remove use of OpenSync from specs
This commit is contained in:
parent
5193e6e46b
commit
c7e308bca0
@ -2,7 +2,7 @@
|
|||||||
ReactEditorView = require '../src/react-editor-view'
|
ReactEditorView = require '../src/react-editor-view'
|
||||||
nbsp = String.fromCharCode(160)
|
nbsp = String.fromCharCode(160)
|
||||||
|
|
||||||
describe "EditorComponent", ->
|
fdescribe "EditorComponent", ->
|
||||||
[editor, wrapperView, component, node, verticalScrollbarNode, horizontalScrollbarNode] = []
|
[editor, wrapperView, component, node, verticalScrollbarNode, horizontalScrollbarNode] = []
|
||||||
[lineHeightInPixels, charWidth, delayAnimationFrames, nextAnimationFrame] = []
|
[lineHeightInPixels, charWidth, delayAnimationFrames, nextAnimationFrame] = []
|
||||||
|
|
||||||
@ -22,7 +22,10 @@ describe "EditorComponent", ->
|
|||||||
else
|
else
|
||||||
fn()
|
fn()
|
||||||
|
|
||||||
editor = atom.project.openSync('sample.js')
|
waitsForPromise ->
|
||||||
|
atom.project.open('sample.js').then (o) -> editor = o
|
||||||
|
|
||||||
|
runs ->
|
||||||
wrapperView = new ReactEditorView(editor)
|
wrapperView = new ReactEditorView(editor)
|
||||||
wrapperView.attachToDom()
|
wrapperView.attachToDom()
|
||||||
{component} = wrapperView
|
{component} = wrapperView
|
||||||
|
@ -6,7 +6,7 @@ describe "TokenizedLine", ->
|
|||||||
|
|
||||||
describe "::getScopeTree()", ->
|
describe "::getScopeTree()", ->
|
||||||
it "returns a tree whose inner nodes are scopes and whose leaf nodes are tokens in those scopes", ->
|
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=[]) ->
|
ensureValidScopeTree = (scopeTree, scopes=[]) ->
|
||||||
if scopeTree.children?
|
if scopeTree.children?
|
||||||
@ -16,7 +16,11 @@ describe "TokenizedLine", ->
|
|||||||
expect(scopeTree).toBe tokens[tokenIndex++]
|
expect(scopeTree).toBe tokens[tokenIndex++]
|
||||||
expect(scopes).toEqual scopeTree.scopes
|
expect(scopes).toEqual scopeTree.scopes
|
||||||
|
|
||||||
tokenIndex = 0
|
waitsForPromise ->
|
||||||
tokens = editor.lineForScreenRow(1).tokens
|
atom.project.open('coffee.coffee').then (o) -> editor = o
|
||||||
scopeTree = editor.lineForScreenRow(1).getScopeTree()
|
|
||||||
ensureValidScopeTree(scopeTree)
|
runs ->
|
||||||
|
tokenIndex = 0
|
||||||
|
tokens = editor.lineForScreenRow(1).tokens
|
||||||
|
scopeTree = editor.lineForScreenRow(1).getScopeTree()
|
||||||
|
ensureValidScopeTree(scopeTree)
|
||||||
|
Loading…
Reference in New Issue
Block a user