Skip to content

Commit 612ca2b

Browse files
committed
Build stylesheets before tests are run
1 parent 1f1d69f commit 612ca2b

File tree

3 files changed

+6
-34
lines changed

3 files changed

+6
-34
lines changed

Gruntfile.js

+1-17
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,8 @@ module.exports = function(grunt) {
2222
var browserOption = grunt.option('browser');
2323
var testsOption = grunt.option('tests');
2424
var jqueryOption = grunt.option('jquery');
25-
var skipStylesheets = grunt.option('skip-styles');
2625
var jquery = 'src/jquery.js';
2726

28-
if (skipStylesheets) {
29-
grunt.log.writeln("Skipping styles");
30-
for (var i = 0; i < TESTS.afterTestFiles.length; i ++) {
31-
var item = TESTS.afterTestFiles[i];
32-
if (typeof item === "string") {
33-
if (item.match(/less\.js/)) {
34-
TESTS.afterTestFiles.splice(i, 1);
35-
}
36-
}
37-
}
38-
}
39-
4027
if (testsOption) {
4128
tests = [ testsOption ];
4229
}
@@ -118,7 +105,6 @@ module.exports = function(grunt) {
118105
browsers: browsers,
119106

120107
files: [].concat(
121-
TESTS.compiledStyleSheets,
122108
TESTS.beforeTestFiles,
123109
TESTS.ciFiles,
124110
TESTS.afterTestFiles,
@@ -135,7 +121,6 @@ module.exports = function(grunt) {
135121
browsers: [ 'bs_chrome' ],
136122

137123
files: [].concat(
138-
TESTS.compiledStyleSheets,
139124
TESTS.beforeTestFiles,
140125
TESTS.ciFiles,
141126
TESTS.afterTestFiles,
@@ -158,7 +143,6 @@ module.exports = function(grunt) {
158143
browsers: [],
159144

160145
files: [].concat(
161-
TESTS.compiledStyleSheets,
162146
TESTS.beforeTestFiles,
163147
allKendoFiles,
164148
TESTS.afterTestFiles.filter(function(x) {
@@ -260,7 +244,7 @@ module.exports = function(grunt) {
260244

261245
// Default task(s).
262246
grunt.registerTask('default', ['karma:unit']);
263-
grunt.registerTask('tests', [ 'karma:unit' ]);
247+
grunt.registerTask('tests', [ 'styles', 'karma:unit' ]);
264248
grunt.registerTask('styles', [ 'copy:css_assets', 'less' ]);
265249
grunt.registerTask('all', [ 'kendo', 'download_builder', 'copy:jquery', 'copy:timezones' ]);
266250
grunt.registerTask('build', [ 'kendo', 'copy:jquery', 'styles', 'license' ]);

build/grunt/test-paths-core.js

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
exports.beforeTestFiles = [
2-
{ pattern: 'styles/**/*.*', watched: true, included: false },
3-
{ pattern: 'tests/router/sandbox.html', watched: true, included: false },
2+
'dist/styles/web/kendo.common.core.min.css',
3+
'dist/styles/mobile/kendo.mobile.all.min.css',
4+
'dist/styles/web/kendo.rtl.css',
5+
{ pattern: 'dist/styles/**/*.*', watched: true, included: false },
46
{ pattern: 'tests/window/blank.html', watched: true, included: false },
57
{ pattern: 'tests/**/*-fixture.html' }
68
];
@@ -11,14 +13,7 @@ exports.afterTestFiles = [
1113
'src/cultures/kendo.culture.en-ZA.js',
1214
"src/cultures/kendo.culture.es-ES.js",
1315
'tests/kendo-test-helpers.js',
14-
'tests/**/test-helper.js',
15-
'build/less-js/dist/less-1.6.0.min.js'
16-
];
17-
18-
exports.compiledStyleSheets = [
19-
'dist/styles/web/kendo.common.core.min.css',
20-
'dist/styles/mobile/kendo.mobile.all.min.css',
21-
'dist/styles/web/kendo.rtl.css'
16+
'tests/**/test-helper.js'
2217
];
2318

2419
exports.ciFiles = [ 'dist/js/kendo.ui.core.min.js' ];

tests/kendo-test-helpers.js

-7
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,6 @@ function mousewheel(element, delta) {
128128
$(element).trigger($.Event("mousewheel", { originalEvent: { detail: delta * 3 } }));
129129
}
130130

131-
if (!$('link[rel=stylesheet][href*="kendo.common.core.min.css"]').length) {
132-
$('head')
133-
.append('<link rel="stylesheet/less" href="/base/styles/web/kendo.common.core.less" />')
134-
.append('<link rel="stylesheet/less" href="/base/styles/mobile/kendo.mobile.all.less" />')
135-
.append('<link rel="stylesheet/less" href="/base/styles/web/kendo.rtl.css" />');
136-
}
137-
138131
(function() {
139132
var domContentsLength;
140133

0 commit comments

Comments
 (0)