Skip to content

Commit 0925cf1

Browse files
authored
Test-data module (#3525)
* Move test data to separate module - @todo--fix some browser tests * Fix all browser tests
1 parent 51fb02b commit 0925cf1

File tree

508 files changed

+237
-7440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

508 files changed

+237
-7440
lines changed

package-lock.json

-7,171
This file was deleted.

packages/less/.eslintignore

-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ Gruntfile.js
22
dist/*
33
tmp/*
44
lib/*
5-
test/browser/vendor/*
65
test/browser/less.min.js

packages/less/Gruntfile.js

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
"use strict";
22

3+
var resolve = require('resolve');
4+
var path = require('path');
5+
6+
var testFolder = path.relative(process.cwd(), path.dirname(resolve.sync('@less/test-data')));
7+
var lessFolder = path.join(testFolder, 'less');
8+
39
module.exports = function(grunt) {
410
grunt.option("stack", true);
511

@@ -235,32 +241,32 @@ module.exports = function(grunt) {
235241
// @TODO: make this more thorough
236242
// CURRENT OPTIONS
237243
// --math
238-
"node bin/lessc --math=always test/less/_main/lazy-eval.less tmp/lazy-eval.css",
239-
"node bin/lessc --math=parens-division test/less/_main/lazy-eval.less tmp/lazy-eval.css",
240-
"node bin/lessc --math=parens test/less/_main/lazy-eval.less tmp/lazy-eval.css",
241-
"node bin/lessc --math=strict test/less/_main/lazy-eval.less tmp/lazy-eval.css",
242-
"node bin/lessc --math=strict-legacy test/less/_main/lazy-eval.less tmp/lazy-eval.css",
244+
`node bin/lessc --math=always ${lessFolder}/_main/lazy-eval.less tmp/lazy-eval.css`,
245+
`node bin/lessc --math=parens-division ${lessFolder}/_main/lazy-eval.less tmp/lazy-eval.css`,
246+
`node bin/lessc --math=parens ${lessFolder}/_main/lazy-eval.less tmp/lazy-eval.css`,
247+
`node bin/lessc --math=strict ${lessFolder}/_main/lazy-eval.less tmp/lazy-eval.css`,
248+
`node bin/lessc --math=strict-legacy ${lessFolder}/_main/lazy-eval.less tmp/lazy-eval.css`,
243249

244250
// DEPRECATED OPTIONS
245251
// --strict-math
246-
"node bin/lessc --strict-math=on test/less/_main/lazy-eval.less tmp/lazy-eval.css"
252+
`node bin/lessc --strict-math=on ${lessFolder}/_main/lazy-eval.less tmp/lazy-eval.css`
247253
].join(" && ")
248254
},
249255
plugin: {
250256
command: [
251-
'node bin/lessc --clean-css="--s1 --advanced" test/less/_main/lazy-eval.less tmp/lazy-eval.css',
257+
`node bin/lessc --clean-css="--s1 --advanced" ${lessFolder}/_main/lazy-eval.less tmp/lazy-eval.css`,
252258
"cd lib",
253-
'node ../bin/lessc --clean-css="--s1 --advanced" ../test/less/_main/lazy-eval.less ../tmp/lazy-eval.css',
259+
`node ../bin/lessc --clean-css="--s1 --advanced" ../${lessFolder}/_main/lazy-eval.less ../tmp/lazy-eval.css`,
254260
"cd ..",
255261
// Test multiple plugins
256-
'node bin/lessc --plugin=clean-css="--s1 --advanced" --plugin=autoprefix="ie 11,Edge >= 13,Chrome >= 47,Firefox >= 45,iOS >= 9.2,Safari >= 9" test/less/_main/lazy-eval.less tmp/lazy-eval.css'
262+
`node bin/lessc --plugin=clean-css="--s1 --advanced" --plugin=autoprefix="ie 11,Edge >= 13,Chrome >= 47,Firefox >= 45,iOS >= 9.2,Safari >= 9" ${lessFolder}/_main/lazy-eval.less tmp/lazy-eval.css`
257263
].join(" && ")
258264
},
259265
"sourcemap-test": {
260266
// quoted value doesn't seem to get picked up by time-grunt, or isn't output, at least; maybe just "sourcemap" is fine?
261267
command: [
262-
"node bin/lessc --source-map=test/sourcemaps/maps/import-map.map test/less/_main/import.less test/sourcemaps/import.css",
263-
"node bin/lessc --source-map test/less/sourcemaps/basic.less test/sourcemaps/basic.css"
268+
`node bin/lessc --source-map=test/sourcemaps/maps/import-map.map ${lessFolder}/_main/import.less test/sourcemaps/import.css`,
269+
`node bin/lessc --source-map ${lessFolder}/sourcemaps/basic.less test/sourcemaps/basic.css`
264270
].join(" && ")
265271
}
266272
},

packages/less/bower.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@
66
"benchmark",
77
"bin",
88
"lib",
9+
"src",
10+
"build",
911
"test",
1012
"*.md",
1113
"LICENSE",
1214
"Gruntfile.js",
1315
"*.json",
1416
"*.yml",
1517
".gitattributes",
16-
".jshintrc",
17-
".npmignore"
18+
".npmignore",
19+
".eslintignore",
20+
"tsconfig.json"
1821
]
1922
}

packages/less/package-lock.json

+40-31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/less/package.json

+13-11
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@
3535
"node": ">=6"
3636
},
3737
"scripts": {
38-
"test": "grunt test",
39-
"grunt": "grunt",
40-
"changelog": "github-changes -o less -r less.js -a --only-pulls --use-commit-body -m \"(YYYY-MM-DD)\"",
41-
"build": "npm-run-all clean compile",
42-
"clean": "shx rm -rf ./lib tsconfig.tsbuildinfo",
43-
"compile": "tsc -p tsconfig.json",
44-
"dev": "tsc -p tsconfig.json -w"
45-
},
38+
"test": "grunt test",
39+
"grunt": "grunt",
40+
"changelog": "github-changes -o less -r less.js -a --only-pulls --use-commit-body -m \"(YYYY-MM-DD)\"",
41+
"build": "npm-run-all clean compile",
42+
"clean": "shx rm -rf ./lib tsconfig.tsbuildinfo",
43+
"compile": "tsc -p tsconfig.json",
44+
"dev": "tsc -p tsconfig.json -w"
45+
},
4646
"optionalDependencies": {
4747
"errno": "^0.1.1",
4848
"graceful-fs": "^4.1.2",
@@ -53,13 +53,14 @@
5353
"source-map": "~0.6.0"
5454
},
5555
"devDependencies": {
56+
"@less/test-data": "3.12.0",
5657
"@less/test-import-module": "3.12.0",
5758
"@typescript-eslint/eslint-plugin": "^3.3.0",
5859
"@typescript-eslint/parser": "^3.3.0",
5960
"benny": "^3.6.12",
6061
"bootstrap-less-port": "0.3.0",
61-
"copy-anything": "^2.0.1",
6262
"chai": "^4.2.0",
63+
"copy-anything": "^2.0.1",
6364
"diff": "^3.2.0",
6465
"eslint": "^6.8.0",
6566
"fs-extra": "^8.1.0",
@@ -80,12 +81,13 @@
8081
"minimist": "^1.2.0",
8182
"mocha": "^6.2.1",
8283
"mocha-headless-chrome": "^2.0.3",
83-
"mocha-teamcity-reporter": "^3.0.0",
84-
"npm-run-all": "^4.1.5",
84+
"mocha-teamcity-reporter": "^3.0.0",
85+
"npm-run-all": "^4.1.5",
8586
"performance-now": "^0.2.0",
8687
"phin": "^2.2.3",
8788
"promise": "^7.1.1",
8889
"read-glob": "^3.0.0",
90+
"resolve": "^1.17.0",
8991
"rollup": "^1.17.0",
9092
"rollup-plugin-commonjs": "^10.0.1",
9193
"rollup-plugin-node-resolve": "^5.2.0",

0 commit comments

Comments
 (0)