|
| 1 | +var lessTest = require("./less-test"), |
| 2 | + lessTester = lessTest(), |
| 3 | + path = require("path"), |
| 4 | + stylize = require('../lib/less/lessc_helper').stylize; |
| 5 | + |
| 6 | +function getErrorPathReplacementFunction(dir) { |
| 7 | + return function(input) { |
| 8 | + return input.replace( |
| 9 | + "{path}", path.join(process.cwd(), "/test/less/" + dir + "/")) |
| 10 | + .replace("{pathrel}", path.join("test", "less", dir + "/")) |
| 11 | + .replace("{pathhref}", "") |
| 12 | + .replace("{404status}", "") |
| 13 | + .replace(/\r\n/g, '\n'); |
| 14 | + }; |
| 15 | +} |
| 16 | + |
| 17 | +console.log("\n" + stylize("LESS", 'underline') + "\n"); |
| 18 | + |
| 19 | +lessTester.runTestSet({strictMath: true, relativeUrls: true, silent: true}); |
| 20 | +lessTester.runTestSet({strictMath: true, strictUnits: true}, "errors/", |
| 21 | + lessTester.testErrors, null, getErrorPathReplacementFunction("errors")); |
| 22 | +lessTester.runTestSet({strictMath: true, strictUnits: true, javascriptEnabled: false}, "no-js-errors/", |
| 23 | + lessTester.testErrors, null, getErrorPathReplacementFunction("no-js-errors")); |
| 24 | +lessTester.runTestSet({strictMath: true, dumpLineNumbers: 'comments'}, "debug/", null, |
| 25 | + function(name) { return name + '-comments'; }); |
| 26 | +lessTester.runTestSet({strictMath: true, dumpLineNumbers: 'mediaquery'}, "debug/", null, |
| 27 | + function(name) { return name + '-mediaquery'; }); |
| 28 | +lessTester.runTestSet({strictMath: true, dumpLineNumbers: 'all'}, "debug/", null, |
| 29 | + function(name) { return name + '-all'; }); |
| 30 | +lessTester.runTestSet({strictMath: true, relativeUrls: false, rootpath: "folder (1)/"}, "static-urls/"); |
| 31 | +lessTester.runTestSet({strictMath: true, compress: true}, "compression/"); |
| 32 | +lessTester.runTestSet({}, "legacy/"); |
| 33 | +lessTester.runTestSet({strictMath: true, strictUnits: true, sourceMap: true }, "sourcemaps/", |
| 34 | + lessTester.testSourcemap, null, null, function(filename) { return path.join('test/sourcemaps', filename) + '.json'; }); |
| 35 | + |
| 36 | +lessTester.testNoOptions(); |
0 commit comments