Skip to content

Commit 45ce97d

Browse files
committed
Allow both types of failures for invalid credentials test
1 parent 185c6ca commit 45ce97d

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

test/tests/remote.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var assert = require("assert");
22
var path = require("path");
33
var local = path.join.bind(path, __dirname);
4+
var _ = require("lodash");
45

56
var garbageCollect = require("../utils/garbage_collect.js");
67

@@ -388,8 +389,15 @@ describe("Remote", function() {
388389
// catches linux / osx failure to use anonymous credentials
389390
// stops callback infinite loop
390391
.catch(function (reason) {
391-
assert.equal(reason.message.replace(/\n|\r/g, ""),
392-
"failed to set credentials: The parameter is incorrect.");
392+
const messageWithoutNewlines = reason.message.replace(/\n|\r/g, "");
393+
const validErrors = [
394+
"Method push has thrown an error.",
395+
"failed to set credentials: The parameter is incorrect."
396+
];
397+
assert.ok(
398+
_.includes(validErrors, messageWithoutNewlines),
399+
"Unexpected error: " + reason.message
400+
);
393401
});
394402
});
395403

0 commit comments

Comments
 (0)