diff --git a/Gruntfile.js b/Gruntfile.js index 324bfe15e..232fb5dd7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -251,13 +251,21 @@ module.exports = function (grunt) { specs: 'test/browser/runner-postProcessor.js', outfile: 'tmp/browser/test-runner-post-processor.html' } + }, + postProcessorPLugin: { + src: ['test/browser/less/postProcessorPlugin/*.less'], + options: { + helpers: 'test/browser/runner-postProcessorPlugin-options.js', + specs: 'test/browser/runner-postProcessorPlugin.js', + outfile: 'tmp/browser/test-runner-post-processor-plugin.html' + } } }, 'saucelabs-jasmine': { all: { options: { - urls: ["post-processor", "global-vars", "modify-vars", "production", "rootpath-relative", + urls: ["post-processor-plugin","post-processor", "global-vars", "modify-vars", "production", "rootpath-relative", "rootpath", "relative-urls", "browser", "no-js-errors", "legacy", "strict-units" ].map(function(testName) { return "http://localhost:8081/tmp/browser/test-runner-" + testName + ".html"; diff --git a/package.json b/package.json index a8de74726..e4728903c 100644 --- a/package.json +++ b/package.json @@ -55,10 +55,10 @@ "grunt-contrib-clean": "^0.6.0", "grunt-contrib-concat": "^0.5.0", "grunt-contrib-connect": "^0.9.0", - "grunt-contrib-jasmine": "^0.8.1", + "grunt-contrib-jasmine": "^0.8.2", "grunt-contrib-jshint": "^0.11.0", "grunt-contrib-uglify": "^0.7.0", - "grunt-jscs": "^1.2.0", + "grunt-jscs": "^1.2.0", "grunt-shell": "^1.1.1", "grunt-browserify": "~3.3.0", "matchdep": "^0.3.0", diff --git a/test/browser/css/postProcessorPlugin/postProcessor.css b/test/browser/css/postProcessorPlugin/postProcessor.css new file mode 100644 index 000000000..8e5489486 --- /dev/null +++ b/test/browser/css/postProcessorPlugin/postProcessor.css @@ -0,0 +1,4 @@ +hr {height:50px;} +.test { + color: white; +} diff --git a/test/browser/less/postProcessorPlugin/postProcessor.less b/test/browser/less/postProcessorPlugin/postProcessor.less new file mode 100644 index 000000000..0d4c0304d --- /dev/null +++ b/test/browser/less/postProcessorPlugin/postProcessor.less @@ -0,0 +1,4 @@ +@color: white; +.test { + color: @color; +} diff --git a/test/browser/runner-postProcessorPlugin-options.js b/test/browser/runner-postProcessorPlugin-options.js new file mode 100644 index 000000000..0fd05dfa3 --- /dev/null +++ b/test/browser/runner-postProcessorPlugin-options.js @@ -0,0 +1,17 @@ +var postProcessor = function() {}; + +postProcessor.prototype = { + process: function (css) { + return 'hr {height:50px;}\n' + css; + } +}; + +var postProcessorPlugin = { + install: function(less, pluginManager) { + pluginManager.addPostProcessor( new postProcessor()); + } +}; + +var less = {logLevel: 4, + errorReporting: "console", + plugins: [postProcessorPlugin]}; diff --git a/test/browser/runner-postProcessorPlugin.js b/test/browser/runner-postProcessorPlugin.js new file mode 100644 index 000000000..25237cd9f --- /dev/null +++ b/test/browser/runner-postProcessorPlugin.js @@ -0,0 +1,3 @@ +describe("less.js postProcessor Plugin", function() { + testLessEqualsInDocument(); +});