mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
add less parsing helper to spec helper
This commit is contained in:
committed by
Corey Johnson
parent
b9604d1baa
commit
2b66b033e0
@@ -4,6 +4,7 @@ window.setUpEnvironment()
|
||||
nakedLoad 'jasmine-jquery'
|
||||
$ = require 'jquery'
|
||||
_ = require 'underscore'
|
||||
{less} = require 'less'
|
||||
Keymap = require 'keymap'
|
||||
Config = require 'config'
|
||||
Point = require 'point'
|
||||
@@ -213,6 +214,13 @@ window.setEditorHeightInLines = (editor, heightInChars, charHeight=editor.lineHe
|
||||
editor.height(charHeight * heightInChars + editor.renderedLines.position().top)
|
||||
$(window).trigger 'resize' # update editor's on-screen lines
|
||||
|
||||
window.parseLessFile = (path) ->
|
||||
content = ""
|
||||
(new less.Parser).parse __read(path), (e, tree) ->
|
||||
throw new Error(e.message, file, e.line) if e
|
||||
content = tree.toCSS()
|
||||
content
|
||||
|
||||
$.fn.resultOfTrigger = (type) ->
|
||||
event = $.Event(type)
|
||||
this.trigger(event)
|
||||
|
||||
Reference in New Issue
Block a user