nconf-lite/test/stores/literal.test.js
Adrien Becchis b8686aeff0 Migrating test to jest ()
* 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

25 lines
839 B
JavaScript

/*
* literal-test.js: Tests for the nconf literal store.
*
* (C) 2011, Charlie Robbins and the Contributors.
*
*/
var nconf = require('../../lib/nconf');
describe('nconf/stores/literal, An instance of nconf.Literal', () => {
var envOptions = {foo: 'bar', one: 2};
it("should have the correct methods defined", () => {
var literal = new nconf.Literal(envOptions);
expect(literal.type).toEqual('literal');
expect(typeof literal.get).toBe('function');
expect(typeof literal.set).toBe('function');
expect(typeof literal.merge).toBe('function');
expect(typeof literal.loadSync).toBe('function');
});
it("should have the correct values in the store", () => {
var literal = new nconf.Literal(envOptions);
expect(literal.store.foo).toEqual('bar');
expect(literal.store.one).toEqual(2);
});
});