mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
Simplify nconf test
This commit is contained in:
@@ -3,31 +3,21 @@ import setupNconf from '../../../../../website/src/libs/api-v3/setupNconf';
|
|||||||
import nconf from 'nconf';
|
import nconf from 'nconf';
|
||||||
|
|
||||||
describe('setupNconf', () => {
|
describe('setupNconf', () => {
|
||||||
afterEach(() => {
|
before(() => {
|
||||||
sandbox.restore();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('sets up nconf to load command line arguments', () => {
|
|
||||||
sandbox.spy(nconf, 'argv');
|
sandbox.spy(nconf, 'argv');
|
||||||
|
|
||||||
setupNconf();
|
|
||||||
|
|
||||||
expect(nconf.argv).to.be.calledOnce;
|
|
||||||
});
|
|
||||||
|
|
||||||
it('sets up nconf to load environmental variables', () => {
|
|
||||||
sandbox.spy(nconf, 'env');
|
sandbox.spy(nconf, 'env');
|
||||||
|
|
||||||
setupNconf();
|
|
||||||
|
|
||||||
expect(nconf.env).to.be.calledOnce;
|
|
||||||
});
|
|
||||||
|
|
||||||
it('sets up nconf to load variables from config file', () => {
|
|
||||||
sandbox.spy(nconf, 'file');
|
sandbox.spy(nconf, 'file');
|
||||||
|
|
||||||
setupNconf();
|
setupNconf();
|
||||||
|
});
|
||||||
|
|
||||||
|
after(() => {
|
||||||
|
sandbox.restore();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('sets up nconf', () => {
|
||||||
|
expect(nconf.argv).to.be.calledOnce;
|
||||||
|
expect(nconf.env).to.be.calledOnce;
|
||||||
expect(nconf.file).to.be.calledOnce;
|
expect(nconf.file).to.be.calledOnce;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user