From 2b66b033e03871888665fef540a1a8d0462cd447 Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Tue, 5 Mar 2013 13:37:41 -0800 Subject: [PATCH] add less parsing helper to spec helper --- spec/spec-helper.coffee | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index 4632db296..c03a9b6ed 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -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)