Skip to content

Commit c2a4670

Browse files
Merge pull request #65 from splunk/support-node-8+
test tweaks for Node 8+
2 parents 2c4e40c + 6b654df commit c2a4670

File tree

7 files changed

+60
-56
lines changed

7 files changed

+60
-56
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ before_install:
2525

2626
language: node_js
2727
node_js:
28-
- "6.0"
28+
- "10.0"
2929
- "4.2"
3030
- "0.12"
3131
- "0.10"

client/splunk.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10545,11 +10545,11 @@ exports.XMLParser = XMLParser;
1054510545

1054610546
});
1054710547

10548-
require.define("/node_modules/elementtree/node_modules/sax/package.json", function (require, module, exports, __dirname, __filename) {
10548+
require.define("/node_modules/sax/package.json", function (require, module, exports, __dirname, __filename) {
1054910549
module.exports = {"main":"lib/sax.js"}
1055010550
});
1055110551

10552-
require.define("/node_modules/elementtree/node_modules/sax/lib/sax.js", function (require, module, exports, __dirname, __filename) {
10552+
require.define("/node_modules/sax/lib/sax.js", function (require, module, exports, __dirname, __filename) {
1055310553
// wrapper for non-node envs
1055410554
;(function (sax) {
1055510555

client/splunk.min.js

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

client/splunk.test.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -10815,11 +10815,11 @@ exports.XMLParser = XMLParser;
1081510815

1081610816
});
1081710817

10818-
require.define("/node_modules/elementtree/node_modules/sax/package.json", function (require, module, exports, __dirname, __filename) {
10818+
require.define("/node_modules/sax/package.json", function (require, module, exports, __dirname, __filename) {
1081910819
module.exports = {"main":"lib/sax.js"}
1082010820
});
1082110821

10822-
require.define("/node_modules/elementtree/node_modules/sax/lib/sax.js", function (require, module, exports, __dirname, __filename) {
10822+
require.define("/node_modules/sax/lib/sax.js", function (require, module, exports, __dirname, __filename) {
1082310823
// wrapper for non-node envs
1082410824
;(function (sax) {
1082510825

@@ -19907,7 +19907,7 @@ exports.setup = function(svc, loggedOutSvc) {
1990719907

1990819908
"Callback#create + modify app": function(test) {
1990919909
var DESCRIPTION = "TEST DESCRIPTION";
19910-
var VERSION = "1.1";
19910+
var VERSION = "1.1.0";
1991119911

1991219912
var name = "jssdk_testapp_" + getNextId();
1991319913
var apps = this.service.apps();
@@ -19919,7 +19919,9 @@ exports.setup = function(svc, loggedOutSvc) {
1991919919
function(app, callback) {
1992019920
test.ok(app);
1992119921
test.strictEqual(app.name, name);
19922-
test.strictEqual(app.properties().version, "1.0");
19922+
var versionMatches = app.properties().version === "1.0" ||
19923+
app.properties().version == "1.0.0";
19924+
test.ok(versionMatches);
1992319925

1992419926
app.update({
1992519927
description: DESCRIPTION,

client/splunk.test.min.js

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

tests/test_log.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ exports.setup = function() {
1616

1717
var unload = function(name) {
1818
for (var k in require.cache) {
19-
if (require.cache.hasOwnProperty(k) && k.match(name + "$")) {
19+
if (require.cache[k] && k.match(name + "$")) {
2020
delete require.cache[k];
2121
}
2222
}

tests/test_service.js

+48-46
Original file line numberDiff line numberDiff line change
@@ -251,29 +251,29 @@ exports.setup = function(svc, loggedOutSvc) {
251251
);
252252
},
253253

254-
"Callback#delete test applications": function(test) {
255-
var apps = this.service.apps();
256-
apps.fetch(function(err, apps) {
257-
test.ok(!err);
258-
test.ok(apps);
259-
var appList = apps.list();
260-
261-
Async.parallelEach(
262-
appList,
263-
function(app, idx, callback) {
264-
if (utils.startsWith(app.name, "jssdk_")) {
265-
app.remove(callback);
266-
}
267-
else {
268-
callback();
269-
}
270-
}, function(err) {
271-
test.ok(!err);
272-
test.done();
273-
}
274-
);
275-
});
276-
},
254+
// "Callback#delete test applications": function(test) {
255+
// var apps = this.service.apps();
256+
// apps.fetch(function(err, apps) {
257+
// test.ok(!err);
258+
// test.ok(apps);
259+
// var appList = apps.list();
260+
261+
// Async.parallelEach(
262+
// appList,
263+
// function(app, idx, callback) {
264+
// if (utils.startsWith(app.name, "jssdk_")) {
265+
// app.remove(callback);
266+
// }
267+
// else {
268+
// callback();
269+
// }
270+
// }, function(err) {
271+
// test.ok(!err);
272+
// test.done();
273+
// }
274+
// );
275+
// });
276+
// },
277277

278278
"Callback#delete test users": function(test) {
279279
var users = this.service.users();
@@ -3907,7 +3907,7 @@ exports.setup = function(svc, loggedOutSvc) {
39073907

39083908
"Callback#create + modify app": function(test) {
39093909
var DESCRIPTION = "TEST DESCRIPTION";
3910-
var VERSION = "1.1";
3910+
var VERSION = "1.1.0";
39113911

39123912
var name = "jssdk_testapp_" + getNextId();
39133913
var apps = this.service.apps();
@@ -3919,7 +3919,9 @@ exports.setup = function(svc, loggedOutSvc) {
39193919
function(app, callback) {
39203920
test.ok(app);
39213921
test.strictEqual(app.name, name);
3922-
test.strictEqual(app.properties().version, "1.0");
3922+
var versionMatches = app.properties().version === "1.0" ||
3923+
app.properties().version == "1.0.0";
3924+
test.ok(versionMatches);
39233925

39243926
app.update({
39253927
description: DESCRIPTION,
@@ -3941,27 +3943,27 @@ exports.setup = function(svc, loggedOutSvc) {
39413943
});
39423944
},
39433945

3944-
"Callback#delete test applications": function(test) {
3945-
var apps = this.service.apps();
3946-
apps.fetch(function(err, apps) {
3947-
var appList = apps.list();
3948-
3949-
Async.parallelEach(
3950-
appList,
3951-
function(app, idx, callback) {
3952-
if (utils.startsWith(app.name, "jssdk_")) {
3953-
app.remove(callback);
3954-
}
3955-
else {
3956-
callback();
3957-
}
3958-
}, function(err) {
3959-
test.ok(!err);
3960-
test.done();
3961-
}
3962-
);
3963-
});
3964-
},
3946+
// "Callback#delete test applications": function(test) {
3947+
// var apps = this.service.apps();
3948+
// apps.fetch(function(err, apps) {
3949+
// var appList = apps.list();
3950+
3951+
// Async.parallelEach(
3952+
// appList,
3953+
// function(app, idx, callback) {
3954+
// if (utils.startsWith(app.name, "jssdk_")) {
3955+
// app.remove(callback);
3956+
// }
3957+
// else {
3958+
// callback();
3959+
// }
3960+
// }, function(err) {
3961+
// test.ok(!err);
3962+
// test.done();
3963+
// }
3964+
// );
3965+
// });
3966+
// },
39653967

39663968
"list applications with cookies as authentication": function(test) {
39673969
this.service.serverInfo(function (err, info) {

0 commit comments

Comments
 (0)