Skip to content

Commit 38e3056

Browse files
committed
clean tests and gruntfile
1 parent 6bf4d4d commit 38e3056

File tree

5 files changed

+25
-26
lines changed

5 files changed

+25
-26
lines changed

Gruntfile.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module.exports = function (grunt) {
6262
// Delete files created by the "testBuild" target.
6363
testBuild: [
6464
"tests/functional/jqueryApp/{bower_components,node_modules,build,tmp}",
65-
"tests/jquery.js" // work around grunt-amd-build bug where it puts files outside of tmp/ dir
65+
"tests/jquery.js" // work around grunt-amd-build bug where it puts files outside of tmp/ dir
6666
]
6767
}
6868
});
@@ -76,7 +76,7 @@ module.exports = function (grunt) {
7676

7777

7878
// By default, lint and run all tests.
79-
grunt.registerTask("default", ["jsbeautifier", "lineending", "jshint", "intern:remote"]);
79+
grunt.registerTask("default", ["jsbeautifier", "lineending", "jshint", "test:remote"]);
8080

8181
// Just lint
8282
grunt.registerTask("lint", ["jsbeautifier", "lineending", "jshint"]);
@@ -116,7 +116,16 @@ module.exports = function (grunt) {
116116
opts: {
117117
cwd: appRootDir
118118
}
119-
}, done.bind(null, true));
119+
}, finish);
120+
}
121+
122+
function finish(error, buildResults) {
123+
if (error !== null) {
124+
grunt.log.writeln(buildResults.stdout);
125+
done(error);
126+
return;
127+
}
128+
done(true);
120129
}
121130

122131
grunt.util.spawn({
@@ -158,7 +167,7 @@ module.exports = function (grunt) {
158167
addReporter("console");
159168
}
160169

161-
// First create the test builds. These are referenced from the intern tests.
170+
// First create the test builds. These are referenced from the intern tests.
162171
grunt.task.run("testBuild");
163172

164173
// Then run the intern tests.

tests/functional/jqueryApp/Gruntfile.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ module.exports = function (grunt) {
1111
var outdir = "./build/";
1212
var tmpdir = "./tmp/";
1313

14-
var common = {
15-
options: { banner: "<%= " + outprop + ".header%>" },
16-
src: "<%= " + outprop + ".modules.abs %>",
17-
dest: outdir + "<%= " + outprop + ".layerPath %>"
18-
};
19-
2014
grunt.initConfig({
2115
amdloader: {
2216
baseUrl: ".",

tests/intern.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,12 @@ define({
3131
version: "33",
3232
platform: "Windows 7",
3333
name: "requirejs-dplugins"
34+
}, {
35+
browserName: "safari",
36+
version: "7",
37+
platform: "OS X 10.9",
38+
name: "requirejs-dplugins"
3439
}
35-
36-
// Disabled because environments are often unavailable on sauce and randomly break the build.
37-
// {
38-
// browserName: "safari",
39-
// version: "7",
40-
// platform: "OS X 10.9",
41-
// name: "requirejs-dplugins"
42-
// }
4340

4441
// Mobile
4542
// Disabled because environments are often unavailable on sauce and randomly break the build.
@@ -95,8 +92,8 @@ define({
9592
suites: ["requirejs-dplugins/tests/unit/all"],
9693

9794
// Functional test suite(s) to run in each browser once non-functional tests are completed
98-
functionalSuites: [ "requirejs-dplugins/tests/functional/all" ],
95+
functionalSuites: ["requirejs-dplugins/tests/functional/all"],
9996

10097
// A regular expression matching URLs to files that should not be included in code coverage analysis
101-
excludeInstrumentation: /(?:requirejs(\/|\\)|dojo|jquery\/|tests|node_modules)/
98+
excludeInstrumentation: /(?:requirejs|jquery|tests|node_modules)(?:\/|\\)/
10299
});

tests/unit/css.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ define([
1111
// to be able to access requirejs-dplugins sibling directories.
1212
// The last /requirejs-dplugins is here to allow to use css! directly instead of
1313
// requirejs-dplugins/css!
14-
baseUrl: "../../../requirejs-dplugins",
15-
paths: {dojo: "../dojo"}
14+
baseUrl: "../../../requirejs-dplugins"
1615
});
1716

1817
function getStyles() {

tests/unit/i18n.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ define([
7171
assert.strictEqual(test.bundleB, "Fr from Layer Bundle B", hint);
7272
}));
7373
},
74-
"fr-fr": function () {
74+
"fr-fr (404 fr-fr expected)": function () {
7575
var dfd = this.async();
7676
var hint = "The text should come from the best layer (ie. fr)";
7777

@@ -89,7 +89,7 @@ define([
8989
assert.strictEqual(test.bundleB, "En from Layer Bundle B", hint);
9090
}));
9191
},
92-
"it": function () {
92+
"it (404 it expected)": function () {
9393
var dfd = this.async();
9494
var hint = "The root layer should be used when a locale does not exist";
9595

@@ -262,7 +262,7 @@ define([
262262
assert.strictEqual(test.bundleD, "Fr from Bundle D", hintBundle);
263263
}));
264264
},
265-
"fr-fr": function () {
265+
"fr-fr (404 fr-fr expected)": function () {
266266
var dfd = this.async();
267267
var hintLayer = "The layer should not be enhanced";
268268
var hintBundle = "The best match should be found";
@@ -309,7 +309,7 @@ define([
309309
assert.strictEqual(test.bundleD, "Fr from Bundle D", hintBundle);
310310
}));
311311
},
312-
"fr-fr": function () {
312+
"fr-fr (404 fr-fr expected)": function () {
313313
var dfd = this.async();
314314
var hintLayer = "The layer should be enhanced";
315315
var hintBundle = "The best match should be found";

0 commit comments

Comments
 (0)