Sun calculation js library which is fully based on formula from http://aa.quae.nl/en/reken/zonpositie.html
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
635 B
16 lines
635 B
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')
|
|
|