nconf-lite/test/stores/env.test.js
Adrien Becchis b8686aeff0 Migrating test to jest (#292)
* set up jest dependencies

* add parser option to eslint to support es6

* migrate first test to jest

* migrate the argv test to shpec

* convert the env and literal store tests

* convert the file-store tests

* convert the memory-store tests

* convert the hierarchy tests

* convert the provider-save test

* convert the complete test

* convert the provider test

* convert the conf test

* tweak a test that was no longer working (context changed)

* replace in place the helpers file

* remove vows dependency

* update the test invocation to rely on jest

* update the argv test to be able to use the jest --verbose option

* Some tweaks to the test to have them working

* Update node version tested (+10 +12 -9)

* Replace const by var until we drop 0.10/0.12/4 node

* Replace let by var until we drop 0.10/0.12/4 node
2019-04-29 22:26:02 -04:00

28 lines
965 B
JavaScript

/*
* env-test.js: Tests for the nconf env store.
*
* (C) 2011, Charlie Robbins and the Contributors.
*
*/
var nconf = require('../../lib/nconf');
describe('nconf/stores/env, An instance of nconf.Env', () => {
it("should have the correct methods defined", () => {
var env = new nconf.Env();
expect(typeof env.loadSync).toBe('function');
expect(typeof env.loadEnv).toBe('function');
expect(env.whitelist instanceof Array).toBeTruthy();
expect(env.whitelist.length).toEqual(0);
expect(env.separator).toEqual('');
});
it("should have the correct methods defined and with readOnly false", () => {
var env = new nconf.Env({readOnly: false});
expect(typeof env.loadSync).toBe('function');
expect(typeof env.loadEnv).toBe('function');
expect(env.whitelist instanceof Array).toBeTruthy();
expect(env.whitelist.length).toEqual(0);
expect(env.separator).toEqual('');
expect(env.readOnly).toBe(false);
});
});