less 3.10.3 → 3.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/FUNDING.yml +12 -0
- package/CHANGELOG.md +509 -711
- package/CONTRIBUTING.md +2 -2
- package/Gruntfile.js +42 -212
- package/README.md +31 -3
- package/bin/lessc +10538 -13511
- package/dist/less.cjs.js +10078 -12936
- package/dist/less.js +10670 -13462
- package/dist/less.min.js +3 -3
- package/dist/less.min.js.map +1 -1
- package/lib/less/contexts.js +1 -1
- package/lib/less/environment/abstract-file-manager.js +1 -1
- package/lib/less/import-manager.js +7 -20
- package/lib/less/index.js +1 -1
- package/lib/less/less-error.js +22 -2
- package/lib/less/parse-tree.js +2 -6
- package/lib/less/parser/parser.js +10 -10
- package/lib/less/tree/debug-info.js +2 -1
- package/lib/less/tree/namespace-value.js +1 -2
- package/lib/less/visitors/visitor.js +10 -2
- package/lib/less-node/file-manager.js +19 -49
- package/lib/lessc.js +3 -22
- package/package.json +21 -16
- package/test/browser/common.js +11 -49
- package/test/browser/generator/benchmark.config.js +50 -0
- package/test/browser/generator/generate.js +78 -0
- package/test/browser/generator/runner.config.js +180 -0
- package/test/browser/generator/runner.js +2 -0
- package/test/browser/generator/template.js +83 -0
- package/test/browser/runner-browser-options.js +0 -6
- package/test/browser/runner-browser-spec.js +1 -1
- package/test/browser/runner-main-spec.js +1 -1
- package/test/browser/runner-modify-vars-spec.js +1 -1
- package/test/browser/runner-production-spec.js +1 -1
- package/test/css/calc.css +9 -0
- package/test/css/comments.css +1 -1
- package/test/css/css-3.css +5 -5
- package/test/css/css-guards.css +1 -1
- package/test/css/debug/linenumbers-all.css +5 -5
- package/test/css/debug/linenumbers-comments.css +5 -5
- package/test/css/debug/linenumbers-mediaquery.css +5 -5
- package/test/css/extend-chaining.css +3 -3
- package/test/css/extend-media.css +1 -1
- package/test/css/extend-nest.css +1 -1
- package/test/css/filemanagerPlugin/filemanager.css +1 -1
- package/test/css/functions-each.css +1 -1
- package/test/css/import-once.css +2 -2
- package/test/css/import-reference-issues.css +1 -1
- package/test/css/import-reference.css +6 -6
- package/test/css/import.css +1 -1
- package/test/css/javascript.css +1 -1
- package/test/css/legacy/legacy.css +1 -1
- package/test/css/math/parens-division/mixins-args.css +1 -1
- package/test/css/math/parens-division/parens.css +1 -1
- package/test/css/math/strict/mixins-args.css +1 -1
- package/test/css/math/strict/parens.css +1 -1
- package/test/css/math/strict-legacy/mixins-args.css +1 -1
- package/test/css/math/strict-legacy/parens.css +1 -1
- package/test/css/media.css +14 -14
- package/test/css/merge.css +10 -10
- package/test/css/mixins-guards.css +6 -6
- package/test/css/mixins.css +2 -2
- package/test/css/namespacing/namespacing-3.css +16 -1
- package/test/css/namespacing/namespacing-4.css +1 -1
- package/test/css/namespacing/namespacing-functions.css +6 -0
- package/test/css/no-strict-math/mixins-guards.css +1 -1
- package/test/css/permissive-parse.css +1 -1
- package/test/css/plugin.css +9 -9
- package/test/css/postProcessorPlugin/postProcessor.css +2 -2
- package/test/css/preProcessorPlugin/preProcessor.css +1 -1
- package/test/css/selectors.css +2 -2
- package/test/css/variables.css +1 -1
- package/test/css/visitorPlugin/visitor.css +1 -1
- package/test/index.js +6 -0
- package/test/less/calc.less +17 -1
- package/test/less/comments.less +1 -1
- package/test/less/css-3.less +5 -5
- package/test/less/css-guards.less +2 -2
- package/test/less/debug/import/test.less +2 -2
- package/test/less/debug/linenumbers.less +3 -3
- package/test/less/errors/color-func-invalid-color.less +1 -1
- package/test/less/errors/color-func-invalid-color.txt +1 -1
- package/test/less/errors/invalid-color-with-comment.less +1 -0
- package/test/less/errors/invalid-color-with-comment.txt +2 -0
- package/test/less/errors/plugin-1.txt +2 -2
- package/test/less/errors/plugin-2.txt +1 -2
- package/test/less/errors/plugin-3.txt +1 -2
- package/test/less/errors/property-ie5-hack.less +1 -1
- package/test/less/extend-chaining.less +3 -3
- package/test/less/extend-media.less +1 -1
- package/test/less/extend-nest.less +1 -1
- package/test/less/filemanagerPlugin/filemanager.less +1 -1
- package/test/less/functions-each.less +1 -1
- package/test/less/import/import-reference.less +1 -1
- package/test/less/import/import-test-f.less +1 -1
- package/test/less/import/json/index.json +11 -0
- package/test/less/import/json/index.less +1 -0
- package/test/less/import-reference-issues/global-scope-import.less +2 -2
- package/test/less/import-reference-issues/global-scope-nested.less +1 -1
- package/test/less/import-reference-issues.less +2 -2
- package/test/less/import-reference.less +1 -1
- package/test/less/javascript.less +1 -1
- package/test/less/legacy/legacy.less +1 -1
- package/test/less/math/parens-division/mixins-args.less +4 -4
- package/test/less/math/parens-division/parens.less +1 -1
- package/test/less/math/strict/mixins-args.less +4 -4
- package/test/less/math/strict/parens.less +1 -1
- package/test/less/math/strict-legacy/mixins-args.less +4 -4
- package/test/less/math/strict-legacy/parens.less +1 -1
- package/test/less/media.less +9 -9
- package/test/less/merge.less +10 -10
- package/test/less/mixins-guards.less +8 -8
- package/test/less/mixins-important.less +3 -3
- package/test/less/mixins.less +2 -2
- package/test/less/namespacing/namespacing-3.less +25 -2
- package/test/less/namespacing/namespacing-4.less +1 -1
- package/test/less/namespacing/namespacing-5.less +2 -2
- package/test/less/namespacing/namespacing-functions.less +26 -0
- package/test/less/no-strict-math/mixins-guards.less +2 -2
- package/test/less/permissive-parse.less +1 -1
- package/test/less/plugin.less +9 -9
- package/test/less/postProcessorPlugin/postProcessor.less +2 -2
- package/test/less/preProcessorPlugin/preProcessor.less +1 -1
- package/test/less/selectors.less +1 -1
- package/test/less/sourcemaps/imported.css +1 -1
- package/test/less/variables.less +1 -1
- package/test/less/visitorPlugin/visitor.less +1 -1
- package/test/less-test.js +45 -11
- package/test/less.js +11 -0
- package/test/sourcemaps/custom-props.json +1 -1
- package/.DS_Store +0 -0
- package/test/.DS_Store +0 -0
- package/test/browser/less.min.js +0 -11
- package/test/browser/less.min.js.map +0 -1
- package/test/browser/onload.js +0 -13
- package/test/browser/test-runner-template.tmpl +0 -105
- package/test/browser/vendor/boot.js +0 -148
- package/test/browser/vendor/jasmine-jsreporter.js +0 -391
- package/test/browser/vendor/promise.js +0 -2
- package/test/css/.DS_Store +0 -0
- package/test/css/math/.DS_Store +0 -0
- package/test/less/.DS_Store +0 -0
- package/test/less/math/.DS_Store +0 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const template = require('./template')
|
|
2
|
+
let config
|
|
3
|
+
const fs = require('fs-extra')
|
|
4
|
+
const path = require('path')
|
|
5
|
+
const globby = require('globby')
|
|
6
|
+
const { runner } = require('mocha-headless-chrome')
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
if (process.argv[2]) {
|
|
10
|
+
config = require(`./${process.argv[2]}.config`)
|
|
11
|
+
} else {
|
|
12
|
+
config = require('./runner.config')
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Generate templates and run tests
|
|
17
|
+
*/
|
|
18
|
+
const tests = []
|
|
19
|
+
const cwd = process.cwd()
|
|
20
|
+
const tmpDir = path.join(cwd, 'tmp', 'browser')
|
|
21
|
+
fs.ensureDirSync(tmpDir)
|
|
22
|
+
fs.copySync(path.join(cwd, 'test', 'browser', 'common.js'), path.join(tmpDir, 'common.js'))
|
|
23
|
+
|
|
24
|
+
let numTests = 0
|
|
25
|
+
let passedTests = 0
|
|
26
|
+
let failedTests = 0
|
|
27
|
+
|
|
28
|
+
/** Will run the runners in a series */
|
|
29
|
+
function runSerial(tasks) {
|
|
30
|
+
var result = Promise.resolve()
|
|
31
|
+
start = Date.now()
|
|
32
|
+
tasks.forEach(task => {
|
|
33
|
+
result = result.then(result => {
|
|
34
|
+
if (result && result.result && result.result.stats) {
|
|
35
|
+
const stats = result.result.stats
|
|
36
|
+
numTests += stats.tests
|
|
37
|
+
passedTests += stats.passes
|
|
38
|
+
failedTests += stats.failures
|
|
39
|
+
}
|
|
40
|
+
return task()
|
|
41
|
+
}, err => {
|
|
42
|
+
console.log(err)
|
|
43
|
+
failedTests += 1
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
return result
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
Object.entries(config).forEach(entry => {
|
|
50
|
+
const test = entry[1]
|
|
51
|
+
const paths = globby.sync(test.src)
|
|
52
|
+
const templateString = template(paths, test.options.helpers, test.options.specs)
|
|
53
|
+
fs.writeFileSync(path.join(cwd, test.options.outfile), templateString)
|
|
54
|
+
tests.push(() => {
|
|
55
|
+
const file = 'http://localhost:8081/' + test.options.outfile
|
|
56
|
+
console.log(file)
|
|
57
|
+
return runner({
|
|
58
|
+
file,
|
|
59
|
+
timeout: 2000,
|
|
60
|
+
args: ['disable-web-security']
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
module.exports = () => runSerial(tests).then(() => {
|
|
66
|
+
if (failedTests > 0) {
|
|
67
|
+
process.stderr.write(failedTests + ' Failed, ' + passedTests + ' passed\n');
|
|
68
|
+
} else {
|
|
69
|
+
process.stdout.write('All Passed ' + passedTests + ' run\n');
|
|
70
|
+
}
|
|
71
|
+
if (failedTests) {
|
|
72
|
+
process.on('exit', function() { process.reallyExit(1); });
|
|
73
|
+
}
|
|
74
|
+
process.exit()
|
|
75
|
+
}, err => {
|
|
76
|
+
process.stderr.write(err.message);
|
|
77
|
+
process.exit()
|
|
78
|
+
})
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
|
|
2
|
+
module.exports = {
|
|
3
|
+
main: {
|
|
4
|
+
// src is used to build list of less files to compile
|
|
5
|
+
src: [
|
|
6
|
+
"test/less/*.less",
|
|
7
|
+
"!test/less/plugin-preeval.less", // uses ES6 syntax
|
|
8
|
+
// Don't test NPM import, obviously
|
|
9
|
+
"!test/less/plugin-module.less",
|
|
10
|
+
"!test/less/import-module.less",
|
|
11
|
+
"!test/less/javascript.less",
|
|
12
|
+
"!test/less/urls.less",
|
|
13
|
+
"!test/less/empty.less"
|
|
14
|
+
],
|
|
15
|
+
options: {
|
|
16
|
+
helpers: "test/browser/runner-main-options.js",
|
|
17
|
+
specs: "test/browser/runner-main-spec.js",
|
|
18
|
+
outfile: "tmp/browser/test-runner-main.html"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
legacy: {
|
|
22
|
+
src: ["test/less/legacy/*.less"],
|
|
23
|
+
options: {
|
|
24
|
+
helpers: "test/browser/runner-legacy-options.js",
|
|
25
|
+
specs: "test/browser/runner-legacy-spec.js",
|
|
26
|
+
outfile: "tmp/browser/test-runner-legacy.html"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
strictUnits: {
|
|
30
|
+
src: ["test/less/strict-units/*.less"],
|
|
31
|
+
options: {
|
|
32
|
+
helpers: "test/browser/runner-strict-units-options.js",
|
|
33
|
+
specs: "test/browser/runner-strict-units-spec.js",
|
|
34
|
+
outfile: "tmp/browser/test-runner-strict-units.html"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
errors: {
|
|
38
|
+
src: [
|
|
39
|
+
"test/less/errors/*.less",
|
|
40
|
+
"!test/less/errors/javascript-error.less",
|
|
41
|
+
"test/browser/less/errors/*.less"
|
|
42
|
+
],
|
|
43
|
+
options: {
|
|
44
|
+
timeout: 20000,
|
|
45
|
+
helpers: "test/browser/runner-errors-options.js",
|
|
46
|
+
specs: "test/browser/runner-errors-spec.js",
|
|
47
|
+
outfile: "tmp/browser/test-runner-errors.html"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
noJsErrors: {
|
|
51
|
+
src: ["test/less/no-js-errors/*.less"],
|
|
52
|
+
options: {
|
|
53
|
+
helpers: "test/browser/runner-no-js-errors-options.js",
|
|
54
|
+
specs: "test/browser/runner-no-js-errors-spec.js",
|
|
55
|
+
outfile: "tmp/browser/test-runner-no-js-errors.html"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
browser: {
|
|
59
|
+
src: [
|
|
60
|
+
"test/browser/less/*.less",
|
|
61
|
+
"test/browser/less/plugin/*.less"
|
|
62
|
+
],
|
|
63
|
+
options: {
|
|
64
|
+
helpers: "test/browser/runner-browser-options.js",
|
|
65
|
+
specs: "test/browser/runner-browser-spec.js",
|
|
66
|
+
outfile: "tmp/browser/test-runner-browser.html"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
relativeUrls: {
|
|
70
|
+
src: ["test/browser/less/relative-urls/*.less"],
|
|
71
|
+
options: {
|
|
72
|
+
helpers: "test/browser/runner-relative-urls-options.js",
|
|
73
|
+
specs: "test/browser/runner-relative-urls-spec.js",
|
|
74
|
+
outfile: "tmp/browser/test-runner-relative-urls.html"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
rewriteUrls: {
|
|
78
|
+
src: ["test/browser/less/rewrite-urls/*.less"],
|
|
79
|
+
options: {
|
|
80
|
+
helpers: "test/browser/runner-rewrite-urls-options.js",
|
|
81
|
+
specs: "test/browser/runner-rewrite-urls-spec.js",
|
|
82
|
+
outfile: "tmp/browser/test-runner-rewrite-urls.html"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
rootpath: {
|
|
86
|
+
src: ["test/browser/less/rootpath/*.less"],
|
|
87
|
+
options: {
|
|
88
|
+
helpers: "test/browser/runner-rootpath-options.js",
|
|
89
|
+
specs: "test/browser/runner-rootpath-spec.js",
|
|
90
|
+
outfile: "tmp/browser/test-runner-rootpath.html"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
rootpathRelative: {
|
|
94
|
+
src: ["test/browser/less/rootpath-relative/*.less"],
|
|
95
|
+
options: {
|
|
96
|
+
helpers: "test/browser/runner-rootpath-relative-options.js",
|
|
97
|
+
specs: "test/browser/runner-rootpath-relative-spec.js",
|
|
98
|
+
outfile: "tmp/browser/test-runner-rootpath-relative.html"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
rootpathRewriteUrls: {
|
|
102
|
+
src: ["test/browser/less/rootpath-rewrite-urls/*.less"],
|
|
103
|
+
options: {
|
|
104
|
+
helpers:
|
|
105
|
+
"test/browser/runner-rootpath-rewrite-urls-options.js",
|
|
106
|
+
specs: "test/browser/runner-rootpath-rewrite-urls-spec.js",
|
|
107
|
+
outfile:
|
|
108
|
+
"tmp/browser/test-runner-rootpath-rewrite-urls.html"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
production: {
|
|
112
|
+
src: ["test/browser/less/production/*.less"],
|
|
113
|
+
options: {
|
|
114
|
+
helpers: "test/browser/runner-production-options.js",
|
|
115
|
+
specs: "test/browser/runner-production-spec.js",
|
|
116
|
+
outfile: "tmp/browser/test-runner-production.html"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
modifyVars: {
|
|
120
|
+
src: ["test/browser/less/modify-vars/*.less"],
|
|
121
|
+
options: {
|
|
122
|
+
helpers: "test/browser/runner-modify-vars-options.js",
|
|
123
|
+
specs: "test/browser/runner-modify-vars-spec.js",
|
|
124
|
+
outfile: "tmp/browser/test-runner-modify-vars.html"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
globalVars: {
|
|
128
|
+
src: ["test/browser/less/global-vars/*.less"],
|
|
129
|
+
options: {
|
|
130
|
+
helpers: "test/browser/runner-global-vars-options.js",
|
|
131
|
+
specs: "test/browser/runner-global-vars-spec.js",
|
|
132
|
+
outfile: "tmp/browser/test-runner-global-vars.html"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
postProcessorPlugin: {
|
|
136
|
+
src: ["test/less/postProcessorPlugin/*.less"],
|
|
137
|
+
options: {
|
|
138
|
+
helpers: [
|
|
139
|
+
"test/plugins/postprocess/index.js",
|
|
140
|
+
"test/browser/runner-postProcessorPlugin-options.js"
|
|
141
|
+
],
|
|
142
|
+
specs: "test/browser/runner-postProcessorPlugin.js",
|
|
143
|
+
outfile:
|
|
144
|
+
"tmp/browser/test-runner-post-processor-plugin.html"
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
preProcessorPlugin: {
|
|
148
|
+
src: ["test/less/preProcessorPlugin/*.less"],
|
|
149
|
+
options: {
|
|
150
|
+
helpers: [
|
|
151
|
+
"test/plugins/preprocess/index.js",
|
|
152
|
+
"test/browser/runner-preProcessorPlugin-options.js"
|
|
153
|
+
],
|
|
154
|
+
specs: "test/browser/runner-preProcessorPlugin.js",
|
|
155
|
+
outfile: "tmp/browser/test-runner-pre-processor-plugin.html"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
visitorPlugin: {
|
|
159
|
+
src: ["test/less/visitorPlugin/*.less"],
|
|
160
|
+
options: {
|
|
161
|
+
helpers: [
|
|
162
|
+
"test/plugins/visitor/index.js",
|
|
163
|
+
"test/browser/runner-VisitorPlugin-options.js"
|
|
164
|
+
],
|
|
165
|
+
specs: "test/browser/runner-VisitorPlugin.js",
|
|
166
|
+
outfile: "tmp/browser/test-runner-visitor-plugin.html"
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
filemanagerPlugin: {
|
|
170
|
+
src: ["test/less/filemanagerPlugin/*.less"],
|
|
171
|
+
options: {
|
|
172
|
+
helpers: [
|
|
173
|
+
"test/plugins/filemanager/index.js",
|
|
174
|
+
"test/browser/runner-filemanagerPlugin-options.js"
|
|
175
|
+
],
|
|
176
|
+
specs: "test/browser/runner-filemanagerPlugin.js",
|
|
177
|
+
outfile: "tmp/browser/test-runner-filemanager-plugin.html"
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
const html = require('html-template-tag')
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Generates HTML templates from list of test sheets
|
|
5
|
+
*/
|
|
6
|
+
module.exports = (stylesheets, helpers, spec, less) => {
|
|
7
|
+
if (!Array.isArray(helpers)) {
|
|
8
|
+
helpers = [helpers]
|
|
9
|
+
}
|
|
10
|
+
return html`
|
|
11
|
+
<!DOCTYPE html>
|
|
12
|
+
<html lang="en">
|
|
13
|
+
<head>
|
|
14
|
+
<meta charset="utf-8">
|
|
15
|
+
|
|
16
|
+
<title>Less.js Spec Runner</title>
|
|
17
|
+
|
|
18
|
+
<!-- for each test, generate CSS/LESS link tags -->
|
|
19
|
+
$${stylesheets.map(function(fullLessName) {
|
|
20
|
+
var pathParts = fullLessName.split('/');
|
|
21
|
+
var fullCssName = fullLessName.replace(/less/g, 'css');
|
|
22
|
+
var lessName = pathParts[pathParts.length - 1];
|
|
23
|
+
var name = lessName.split('.')[0];
|
|
24
|
+
return `
|
|
25
|
+
<!-- the tags to be generated -->
|
|
26
|
+
<link id="original-less:test-less-${name}" title="test-less-${name}" rel="stylesheet/less" type="text/css" href="../../${fullLessName}">
|
|
27
|
+
<link id="expected-less:test-less-${name}" rel="stylesheet" type="text/css" href="../../${fullCssName}">
|
|
28
|
+
` }).join('')}
|
|
29
|
+
|
|
30
|
+
$${helpers.map(helper => `
|
|
31
|
+
<script src="../../${helper}"></script>
|
|
32
|
+
`).join('')}
|
|
33
|
+
|
|
34
|
+
<link rel="stylesheet" href="../../node_modules/mocha/mocha.css">
|
|
35
|
+
</head>
|
|
36
|
+
|
|
37
|
+
<body>
|
|
38
|
+
<!-- content -->
|
|
39
|
+
<div id="mocha"></div>
|
|
40
|
+
<script src="../../node_modules/mocha/mocha.js"></script>
|
|
41
|
+
<script src="../../node_modules/mocha-teamcity-reporter/lib/teamcityBrowser.js"></script>
|
|
42
|
+
<script src="../../node_modules/chai/chai.js"></script>
|
|
43
|
+
<script>
|
|
44
|
+
expect = chai.expect
|
|
45
|
+
mocha.setup({
|
|
46
|
+
ui: 'bdd',
|
|
47
|
+
timeout: 1500
|
|
48
|
+
});
|
|
49
|
+
</script>
|
|
50
|
+
<script src="common.js"></script>
|
|
51
|
+
<script src="../../${spec}"></script>
|
|
52
|
+
<script src="${less || 'less.min.js'}"></script>
|
|
53
|
+
<script>
|
|
54
|
+
/** Saucelabs config */
|
|
55
|
+
onload = function() {
|
|
56
|
+
var runner = mocha.run();
|
|
57
|
+
|
|
58
|
+
var failedTests = [];
|
|
59
|
+
runner.on('end', function() {
|
|
60
|
+
window.mochaResults = runner.stats;
|
|
61
|
+
window.mochaResults.reports = failedTests;
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
runner.on('fail', logFailure);
|
|
65
|
+
|
|
66
|
+
function logFailure(test, err){
|
|
67
|
+
var flattenTitles = function(test){
|
|
68
|
+
var titles = [];
|
|
69
|
+
while (test.parent.title) {
|
|
70
|
+
titles.push(test.parent.title);
|
|
71
|
+
test = test.parent;
|
|
72
|
+
}
|
|
73
|
+
return titles.reverse();
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
failedTests.push({name: test.title, result: false, message: err.message, stack: err.stack, titles: flattenTitles(test) });
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
</script>
|
|
80
|
+
</body>
|
|
81
|
+
</html>
|
|
82
|
+
`
|
|
83
|
+
}
|
|
@@ -5,12 +5,6 @@ var less = {
|
|
|
5
5
|
math: 'always'
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
// There originally run inside describe method. However, since they have not
|
|
9
|
-
// been inside it, they run at jasmine compile time (not runtime). It all
|
|
10
|
-
// worked cause less.js was in async mode and custom phantom runner had
|
|
11
|
-
// different setup then grunt-contrib-jasmine. They have been created before
|
|
12
|
-
// less.js run, even as they have been defined in spec.
|
|
13
|
-
|
|
14
8
|
// test inline less in style tags by grabbing an assortment of less files and doing `@import`s
|
|
15
9
|
var testFiles = ['charsets', 'colors', 'comments', 'css-3', 'strings', 'media', 'mixins'],
|
|
16
10
|
testSheets = [];
|
|
@@ -2,7 +2,7 @@ describe('less.js browser behaviour', function() {
|
|
|
2
2
|
testLessEqualsInDocument();
|
|
3
3
|
|
|
4
4
|
it('has some log messages', function() {
|
|
5
|
-
expect(logMessages.length).
|
|
5
|
+
expect(logMessages.length).to.be.above(0);
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
for (var i = 0; i < testFiles.length; i++) {
|
|
@@ -27,7 +27,7 @@ describe('less.js modify vars', function () {
|
|
|
27
27
|
var xhrLogMessages = logMessages.filter(function (item) {
|
|
28
28
|
return (/XHR: Getting '/).test(item);
|
|
29
29
|
});
|
|
30
|
-
expect(xhrLogMessages.length).
|
|
30
|
+
expect(xhrLogMessages.length).to.equal(2);
|
|
31
31
|
done();
|
|
32
32
|
});
|
|
33
33
|
});
|
package/test/css/calc.css
CHANGED
package/test/css/comments.css
CHANGED
package/test/css/css-3.css
CHANGED
|
@@ -18,21 +18,21 @@ p:not([class*="lead"]) {
|
|
|
18
18
|
color: black;
|
|
19
19
|
}
|
|
20
20
|
input[type="text"].class#id[attr=32]:not(1) {
|
|
21
|
-
color:
|
|
21
|
+
color: inherit;
|
|
22
22
|
}
|
|
23
23
|
div#id.class[a=1][b=2].class:not(1) {
|
|
24
|
-
color:
|
|
24
|
+
color: inherit;
|
|
25
25
|
}
|
|
26
26
|
ul.comma > li:not(:only-child)::after {
|
|
27
|
-
color:
|
|
27
|
+
color: inherit;
|
|
28
28
|
}
|
|
29
29
|
ol.comma > li:nth-last-child(2)::after {
|
|
30
|
-
color:
|
|
30
|
+
color: inherit;
|
|
31
31
|
}
|
|
32
32
|
li:nth-child(4n+1),
|
|
33
33
|
li:nth-child(-5n),
|
|
34
34
|
li:nth-child(-n+2) {
|
|
35
|
-
color:
|
|
35
|
+
color: inherit;
|
|
36
36
|
}
|
|
37
37
|
a[href^="http://"] {
|
|
38
38
|
color: black;
|
package/test/css/css-guards.css
CHANGED
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
}
|
|
10
10
|
/* line 15, {path}linenumbers.less */
|
|
11
11
|
@media -sass-debug-info{filename{font-family:file\:\/\/{pathesc}linenumbers\.less}line{font-family:\0000315}}
|
|
12
|
-
.
|
|
12
|
+
.test-rule1 {
|
|
13
13
|
color: black;
|
|
14
14
|
}
|
|
15
15
|
/* line 6, {path}linenumbers.less */
|
|
16
16
|
@media -sass-debug-info{filename{font-family:file\:\/\/{pathesc}linenumbers\.less}line{font-family:\000036}}
|
|
17
|
-
.
|
|
17
|
+
.test-rule2 {
|
|
18
18
|
color: red;
|
|
19
19
|
}
|
|
20
20
|
@media all {
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
/* line 9, {pathimport}test.less */
|
|
34
34
|
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000039}}
|
|
35
35
|
.tst .tst3 {
|
|
36
|
-
color:
|
|
36
|
+
color: inherit;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
/* line 18, {pathimport}test.less */
|
|
40
40
|
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\0000318}}
|
|
41
41
|
.tst2 {
|
|
42
|
-
color:
|
|
42
|
+
color: inherit;
|
|
43
43
|
}
|
|
44
44
|
/* line 27, {path}linenumbers.less */
|
|
45
45
|
@media -sass-debug-info{filename{font-family:file\:\/\/{pathesc}linenumbers\.less}line{font-family:\0000327}}
|
|
46
|
-
.test {
|
|
46
|
+
.test-rule {
|
|
47
47
|
color: red;
|
|
48
48
|
width: 2;
|
|
49
49
|
}
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
color: grey;
|
|
7
7
|
}
|
|
8
8
|
/* line 15, {path}linenumbers.less */
|
|
9
|
-
.
|
|
9
|
+
.test-rule1 {
|
|
10
10
|
color: black;
|
|
11
11
|
}
|
|
12
12
|
/* line 6, {path}linenumbers.less */
|
|
13
|
-
.
|
|
13
|
+
.test-rule2 {
|
|
14
14
|
color: red;
|
|
15
15
|
}
|
|
16
16
|
@media all {
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
}
|
|
27
27
|
/* line 9, {pathimport}test.less */
|
|
28
28
|
.tst .tst3 {
|
|
29
|
-
color:
|
|
29
|
+
color: inherit;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
/* line 18, {pathimport}test.less */
|
|
33
33
|
.tst2 {
|
|
34
|
-
color:
|
|
34
|
+
color: inherit;
|
|
35
35
|
}
|
|
36
36
|
/* line 27, {path}linenumbers.less */
|
|
37
|
-
.test {
|
|
37
|
+
.test-rule {
|
|
38
38
|
color: red;
|
|
39
39
|
width: 2;
|
|
40
40
|
}
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
color: grey;
|
|
7
7
|
}
|
|
8
8
|
@media -sass-debug-info{filename{font-family:file\:\/\/{pathesc}linenumbers\.less}line{font-family:\0000315}}
|
|
9
|
-
.
|
|
9
|
+
.test-rule1 {
|
|
10
10
|
color: black;
|
|
11
11
|
}
|
|
12
12
|
@media -sass-debug-info{filename{font-family:file\:\/\/{pathesc}linenumbers\.less}line{font-family:\000036}}
|
|
13
|
-
.
|
|
13
|
+
.test-rule2 {
|
|
14
14
|
color: red;
|
|
15
15
|
}
|
|
16
16
|
@media all {
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
}
|
|
27
27
|
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000039}}
|
|
28
28
|
.tst .tst3 {
|
|
29
|
-
color:
|
|
29
|
+
color: inherit;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\0000318}}
|
|
33
33
|
.tst2 {
|
|
34
|
-
color:
|
|
34
|
+
color: inherit;
|
|
35
35
|
}
|
|
36
36
|
@media -sass-debug-info{filename{font-family:file\:\/\/{pathesc}linenumbers\.less}line{font-family:\0000327}}
|
|
37
|
-
.test {
|
|
37
|
+
.test-rule {
|
|
38
38
|
color: red;
|
|
39
39
|
width: 2;
|
|
40
40
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
.i.j,
|
|
17
17
|
.k.j {
|
|
18
|
-
color:
|
|
18
|
+
color: inherit;
|
|
19
19
|
}
|
|
20
20
|
.l,
|
|
21
21
|
.m,
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
}
|
|
59
59
|
.vb,
|
|
60
60
|
.vc {
|
|
61
|
-
color:
|
|
61
|
+
color: inherit;
|
|
62
62
|
}
|
|
63
63
|
@media tv {
|
|
64
64
|
.ma,
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
.ma,
|
|
71
71
|
.mb,
|
|
72
72
|
.mc {
|
|
73
|
-
color:
|
|
73
|
+
color: inherit;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
@media tv and plasma {
|
package/test/css/extend-nest.css
CHANGED
package/test/css/import-once.css
CHANGED