forked from enviPath/enviPy
Current Dev State
This commit is contained in:
16
static/js/ketcher2/node_modules/own-or-env/test.js
generated
vendored
Normal file
16
static/js/ketcher2/node_modules/own-or-env/test.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
var assert = require('assert')
|
||||
var ownOrEnv = require('./')
|
||||
|
||||
process.env.OWN_OR_BOOL_TRUE = '1'
|
||||
process.env.OWN_OR_BOOL_FALSE = '0'
|
||||
process.env.OWN_OR_STRING = 'foo'
|
||||
|
||||
var conf = { t: true, f: false, s: 'bar' }
|
||||
assert.equal(ownOrEnv(conf, 't', 'OWN_OR_BOOL_FALSE', true), true)
|
||||
assert.equal(ownOrEnv(conf, 'x', 'OWN_OR_BOOL_FALSE', true), false)
|
||||
assert.equal(ownOrEnv(conf, 'f', 'OWN_OR_BOOL_TRUE', true), false)
|
||||
assert.equal(ownOrEnv(conf, 'x', 'OWN_OR_BOOL_TRUE', true), true)
|
||||
assert.equal(ownOrEnv(conf, 's', 'OWN_OR_STRING'), 'bar')
|
||||
assert.equal(ownOrEnv(conf, 'x', 'OWN_OR_STRING'), 'foo')
|
||||
|
||||
console.log('TAP version 13\nok\n1..1')
|
||||
Reference in New Issue
Block a user