let tests pass in all environments
the `.invalid` domain name is a special, reserved domain name best
suitable for testing purposes, as it happens that some clients
have something running on some domains or are routed somewhere.
list of reserved domain names:
http://www.iana.org/assignments/special-use-domain-names/special-use-domain-names.xhtml
reference:
http://tools.ietf.org/html/rfc6761
PR: #20
PR-URL: https://github.com/apache/couchdb-nmo/pull/20
Reviewed-By: garren smith <garren.smith@gmail.com>
diff --git a/test/activetasks.js b/test/activetasks.js
index 77487ce..1ad1777 100644
--- a/test/activetasks.js
+++ b/test/activetasks.js
@@ -132,7 +132,7 @@
it('returns error for bad connections', () => {
- return getActiveTask('http://127.1.1.10')
+ return getActiveTask('http://doesnotexist.invalid')
.catch(err => {
assert.ok(/Could not connect/.test(err.message));
});
diff --git a/test/couch-config.js b/test/couch-config.js
index a57f7cb..dd48e31 100644
--- a/test/couch-config.js
+++ b/test/couch-config.js
@@ -74,9 +74,9 @@
it('getConfig throws error on bad url', () => {
return getConfig('node1', 'bad-url')
- .catch(err => {
- assert.ok(/not a valid url/.test(err.message));
- });
+ .catch(err => {
+ assert.ok(/not a valid url/.test(err.message));
+ });
});
it('getConfig throws error on invalid protocol', () => {
@@ -87,7 +87,7 @@
});
it('gets config bad url returns false', () => {
- return getConfig('node1', 'http://127.0.0.2/')
+ return getConfig('node1', 'http://badurl.invalid')
.catch(err => {
assert.ok(/Could not find node/.test(err.message));
});