add less parsing helper to spec helper

This commit is contained in:
Justin Palmer
2013-03-05 13:37:41 -08:00
committed by Corey Johnson
parent b9604d1baa
commit 2b66b033e0

View File

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