Skip to content

Commit

Permalink
Merge pull request #2489 from bassjobsen/browser-plugin-test
Browse files Browse the repository at this point in the history
add browser postProcessor Plugin test
  • Loading branch information
lukeapage committed Mar 2, 2015
2 parents 95441fa + 553e75f commit c3b2be8
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 3 deletions.
10 changes: 9 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions test/browser/css/postProcessorPlugin/postProcessor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
hr {height:50px;}
.test {
color: white;
}
4 changes: 4 additions & 0 deletions test/browser/less/postProcessorPlugin/postProcessor.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@color: white;
.test {
color: @color;
}
17 changes: 17 additions & 0 deletions test/browser/runner-postProcessorPlugin-options.js
Original file line number Diff line number Diff line change
@@ -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]};
3 changes: 3 additions & 0 deletions test/browser/runner-postProcessorPlugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
describe("less.js postProcessor Plugin", function() {
testLessEqualsInDocument();
});

0 comments on commit c3b2be8

Please sign in to comment.