21 lines
438 B
JavaScript
21 lines
438 B
JavaScript
|
var assert = require('assert');
|
||
|
|
||
|
var getenv = require('../lib/getenv');
|
||
|
|
||
|
var tests = {};
|
||
|
|
||
|
// order dependent test
|
||
|
tests['getenv.disableFallbacks() makes relying on fallbacks an error'] = function() {
|
||
|
getenv.disableFallbacks();
|
||
|
assert.throws(function() {
|
||
|
getenv.string('url', 'http://localhost');
|
||
|
});
|
||
|
getenv.enableFallbacks();
|
||
|
};
|
||
|
|
||
|
|
||
|
Object.keys(tests).forEach(function(key) {
|
||
|
console.log('Test: %s', key);
|
||
|
tests[key]();
|
||
|
});
|