mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
Merge pull request #2489 from bassjobsen/browser-plugin-test
add browser postProcessor Plugin test
This commit is contained in:
10
Gruntfile.js
10
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";
|
||||
|
||||
@@ -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",
|
||||
|
||||
4
test/browser/css/postProcessorPlugin/postProcessor.css
Normal file
4
test/browser/css/postProcessorPlugin/postProcessor.css
Normal file
@@ -0,0 +1,4 @@
|
||||
hr {height:50px;}
|
||||
.test {
|
||||
color: white;
|
||||
}
|
||||
4
test/browser/less/postProcessorPlugin/postProcessor.less
Normal file
4
test/browser/less/postProcessorPlugin/postProcessor.less
Normal file
@@ -0,0 +1,4 @@
|
||||
@color: white;
|
||||
.test {
|
||||
color: @color;
|
||||
}
|
||||
17
test/browser/runner-postProcessorPlugin-options.js
Normal file
17
test/browser/runner-postProcessorPlugin-options.js
Normal file
@@ -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
test/browser/runner-postProcessorPlugin.js
Normal file
3
test/browser/runner-postProcessorPlugin.js
Normal file
@@ -0,0 +1,3 @@
|
||||
describe("less.js postProcessor Plugin", function() {
|
||||
testLessEqualsInDocument();
|
||||
});
|
||||
Reference in New Issue
Block a user