Skip to content

Commit 865d14c

Browse files
committed
fix the build with updated sauce credential and some jhint fixes
1 parent f895763 commit 865d14c

File tree

4 files changed

+49
-60
lines changed

4 files changed

+49
-60
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ before_script:
44
- npm install -g grunt-cli
55
script:
66
- grunt jshint
7-
- node node_modules/intern/runner.js config=tests/sauce
7+
- grunt intern:sauce
88
env:
99
global:
10-
- secure: PejwKh/cHv07TFKJEbTonawNYvKxgbJ9Syb8uRzU3RzzFrlGi9NFQFQHvHrfOF523m1zoEVmtWqBajgvjfHf9ZJvCtOsW0H6zk3W2HBXoc/M7cd+bZ9Cs3EkOJ4xvdqlmXa3bOGT81tDYiX5cdYfLdM7oGQN/jBW7I/CaVYKSHQ=
11-
- secure: C4L3dF10u/vKEluIThdV/lFZHPLND8gWzGQUvxVjXHXo5cxgJupPNlWLI8O2Ou7ZLcgZoAkXHRNz07guQGT/2sT9UHJ3rcprrw4P+2g7VVFz+r3tDHqfY75ln9hEtmVdzto8vDykohLkDHJO5Nh827Ig7X9bE3zNu+GpxTUjHvk=
12-
- secure: k0rsaIir/qVCI788nnkMvHS80QN1i4Q2jTipDCS6CKoyErJv0NjqCRvFfWWRDK9qty1xffeeOu143hVF76OrRMsftufeCeQxIPJPqrW/fyansyC3ZpHYTANFidp/h8dZ4kU/vzP85OVicpiWb3aP7TyZiuAe7qkiUAmq1vWeopE=
13-
- secure: NZ9ACuMh0yfi03NwK57LFNK72IF76EVmR6R7o86fLQ4lsn/HVyvfs+NDlPIXCM8yR0IDIDlmk2+P+HwYrvr3YU4PxhbVKIondGvCTwS/iSGRnID8VXSJTcpU9eBKPZ2bsbOA/MudNUlby2/anXNnvcFzvEZV8k/u1bb1OG2IqRw=
10+
- secure: XLYGQvZeJm/PUnzGGefzFEd5qot9FBSoNiZn3Fx+ctNQP+WIB1K1NiqG/Dxb2+l563GpRhMxlBwrAlMVxbWT82uBlCQP+PLJbsv7sW3pUVRSf90dBtHGTxLIaPpTkdKNhI1gzvmtdSMUrgSneuEX0iN2Ij5DrIYF//2Diyk7VqM=
11+
- secure:I1QVQPjcSS16dfyoVD8hFcgbb3q/66nO/lHo03sbCgvUGlQkAaG0WQBDnEPvldmUsPlOPfmJHpxvqSeenpoqDloXy5OqnO4Qj2NZLXk2Bfc3kGn1LTPbT7Qx5cChEJlt3tjjdokj06xI0/N31DL2keJ2ITEUyZzdhsjeBLdlUP0=
12+
- secure:oMm8aXLfkPltyoG3lCn30CgHDK4qThNfdbmfvI2dUm3QDG+oMMS/LYDTZT9HASFRrTIMhrbUU8tIwdkFRU3IMISncZfdpm7v67hj2dT4ScDj5pahkGWVeD+ObcfP1kE129COpEmSpgq22qm8d+N1G348tDuzosYe+NN/FslYyY0=
13+
- secure:PlQTzRQ1ci4/kBo9WIK0JYZipPJ2GeJjSYn/NNJWiHDr4t46AJfip61LpSw88GbgCNkL7JEVygDsaZB7AUP7DfX0o4iqEovMKuwSzcmstGHgQT+GihVff/avYvygPdPn5WpkCUorIB9jrx9FBqSMNWH9bvXYc525w9lY4+X/bfE=

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ module.exports = function (grunt) {
5252
options: {
5353
runType: 'runner', // defaults to 'client'
5454
config: 'tests/sauce',
55-
reporters: ['console', 'lcov']
55+
reporters: ['console']
5656
}
5757
},
5858
local: {

has.js

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
define(["module"], function(module){
1+
define(["module"], function (module) {
22
var cache = (module.config && module.config()) || {};
3-
3+
44
function resolve(resource, has, isBuild) {
55
var tokens = resource.match(/[\?:]|[^:\?]+/g);
66
var i = 0;
7-
console.log(resource)
8-
get = function(skip){
7+
var get = function (skip) {
98
var term = tokens[i++];
10-
if(term === ":"){
9+
if (term === ":") {
1110
// empty string module name; therefore, no dependency
1211
return "";
13-
}else{
12+
} else {
1413
// postfixed with a ? means it is a feature to branch on, the term is the name of the feature
15-
if(tokens[i++] === "?"){
14+
if (tokens[i++] === "?") {
1615
var hasResult = has(term);
17-
if(hasResult === undefined && isBuild){
16+
if (hasResult === undefined && isBuild) {
1817
return undefined;
19-
}else if(!skip && hasResult){
18+
} else if (!skip && hasResult) {
2019
// matched the feature, get the first value from the options
2120
return get();
22-
}else{
21+
} else {
2322
// did not match, get the second value, passing over the first
2423
get(true);
2524
return get(skip);
@@ -28,53 +27,63 @@ define(["module"], function(module){
2827
// a module
2928
return term;
3029
}
31-
}
30+
};
3231
return get();
3332
}
34-
35-
var has = function(name){
36-
var global = (function (){
37-
return this;
33+
34+
var has = function (name) {
35+
var global = (function () {
36+
return this;
3837
})();
39-
38+
4039
return typeof cache[name] === "function" ? (cache[name] = cache[name](global)) : cache[name]; // Boolean
4140
};
4241

4342
has.cache = cache;
4443

45-
has.add = function(name, test, now, force){
44+
has.add = function (name, test, now, force) {
4645
(typeof cache[name] === "undefined" || force) && (cache[name] = test);
4746
return now && has(name);
4847
};
49-
50-
has.normalize = function(resource, normalize){
48+
49+
has.normalize = function (resource, normalize) {
5150
var tokens = resource.match(/[\?:]|[^:\?]+/g);
52-
51+
5352
for (var i = 0; i < tokens.length; i++) {
54-
if (tokens[i] !== ":" && tokens[i] !== "?" && tokens[i+1] !== "?") {
55-
tokens[i] = normalize(tokens[i]);
53+
if (tokens[i] !== ":" && tokens[i] !== "?" && tokens[i + 1] !== "?") {
54+
// The module could be another plugin
55+
var parts = tokens[i].split("!");
56+
parts = parts.map(normalize);
57+
tokens[i] = parts.join("!");
5658
}
5759
}
58-
60+
5961
return tokens.join("");
6062
};
6163

62-
has.load = function(resource, req, onLoad, config){
64+
has.load = function (resource, req, onLoad, config) {
6365
config = config || {};
64-
66+
6567
if (!resource || config.isBuild) {
6668
onLoad();
6769
return;
6870
}
69-
71+
7072
var mid = resolve(resource, has, config.isBuild);
71-
72-
if(mid){
73+
74+
if (mid) {
7375
req([mid], onLoad);
74-
}else{
76+
} else {
7577
onLoad();
7678
}
7779
};
7880

81+
has.addModules = function (pluginName, resource, addModules) {
82+
var mid = resolve(resource, has, true);
83+
if (mid) {
84+
addModules([mid]);
85+
}
86+
};
87+
7988
return has;
8089
});

tests/sauce.js

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,15 @@ define({
99
// A fully qualified URL to the Intern proxy
1010
proxyUrl: "http://127.0.0.1:9000/",
1111

12-
// Default desired capabilities for all environments. Individual capabilities can be overridden by any of the
13-
// specified browser environments in the `environments` array below as well. See
14-
// https://code.google.com/p/selenium/wiki/DesiredCapabilities for standard Selenium capabilities and
15-
// https://saucelabs.com/docs/additional-config#desired-capabilities for Sauce Labs capabilities.
16-
// Note that the `build` capability will be filled in with the current commit ID from the Travis CI environment
17-
// automatically
18-
capabilities: {
19-
"selenium-version": "2.37.0",
20-
"idle-timeout": 30
21-
},
22-
2312
// Browsers to run integration testing against. Note that version numbers must be strings if used with Sauce
2413
// OnDemand. Options that will be permutated are browserName, version, platform, and platformVersion; any other
2514
// capabilities options specified for an environment will be copied as-is
2615
environments: [
27-
// Desktop.
28-
// { browserName: "internet explorer", version: "11", platform: "Windows 8.1" },
29-
// { browserName: "internet explorer", version: "10", platform: "Windows 8" },
30-
{ browserName: "firefox", version: "25"},
31-
{ browserName: "chrome", version: "33"}//, version: "", platform: [ /*"OS X 10.6", "Linux", */ "Windows 7" ] },
32-
// { browserName: "safari", version: "6", platform: [ "OS X 10.8" ] },
33-
34-
// // Mobile
35-
// { browserName: "android", platform: "Android" },
36-
// { browserName: "iphone",
37-
// platform: "OS X 10.8",
38-
// version: "6.1",
39-
// "device-orientation": "portrait",
40-
// "selenium-version": "" }
16+
{ browserName: "internet explorer", version: "11", platform: "Windows 8.1", name : "requirejs-dplugins" },
17+
{ browserName: "internet explorer", version: "10", platform: "Windows 8", name : "requirejs-dplugins" },
18+
{ browserName: "firefox", version: "25", platform: "Windows 7", name : "requirejs-dplugins" },
19+
{ browserName: "chrome", version: "33", platform: "Windows 7", name : "requirejs-dplugins" },
20+
{ browserName: "safari", version: "7", platform: "OS X 10.9", name : "requirejs-dplugins" }
4121
],
4222

4323
// Maximum number of simultaneous integration tests that should be executed on the remote WebDriver service

0 commit comments

Comments
 (0)