Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit 451b42a

Browse files
committed
fix test reliance on wskprops APIHOST being defined
Fixes #860
1 parent 2381194 commit 451b42a

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

tests/lib/openwhisk.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,19 @@ const localWskProps = () => {
1818
exports.entities = ["action", "trigger", "rule", "package"]
1919

2020
exports.cleanAll = auth => {
21-
const ow = require('openwhisk')({
22-
apihost: process.env.__OW_API_HOST || process.env.API_HOST || process.env.APIHOST || localWskProps().APIHOST || 'openwhisk.ng.bluemix.net',
23-
api_key: auth || process.env.__OW_API_KEY || process.env.AUTH || localWskProps().AUTH,
24-
ignore_certs: process.env.IGNORE_CERTS || process.env.INSECURE_SSL || localWskProps().INSECURE_SSL || localWskProps().APIHOST.indexOf('localhost') >= 0 || localWskProps().APIHOST.startsWith('192.') || localWskProps().APIHOST.startsWith('172.') || localWskProps().APIHOST.startsWith('https://192.') || localWskProps().APIHOST.startsWith('https://172.')
25-
})
21+
const apihost = process.env.__OW_API_HOST || process.env.API_HOST || process.env.APIHOST || localWskProps().APIHOST || 'openwhisk.ng.bluemix.net',
22+
opts = {
23+
apihost,
24+
api_key: auth || process.env.__OW_API_KEY || process.env.AUTH || localWskProps().AUTH,
25+
ignore_certs: process.env.IGNORE_CERTS || process.env.INSECURE_SSL || localWskProps().INSECURE_SSL
26+
|| apihost.indexOf('localhost') >= 0
27+
|| apihost.startsWith('192.')
28+
|| apihost.startsWith('172.')
29+
|| apihost.startsWith('https://192.')
30+
|| apihost.startsWith('https://172.')
31+
}
32+
33+
const ow = require('openwhisk')(opts)
2634

2735
/** log a message, then call the given function */
2836
const logThen = f => msg => {

0 commit comments

Comments
 (0)