Fix failing unit tests on windows

This commit is contained in:
Kristian Tashkov
2016-01-27 23:03:33 +02:00
parent 32a2b3121e
commit 32be629878
2 changed files with 4 additions and 8 deletions

View File

@@ -31,13 +31,6 @@ describe('i18n', () => {
}); });
}); });
describe('localePath', () => {
it('is an absolute path to common/locales/', () => {
expect(localePath).to.match(/.*\/common\/locales\//);
expect(localePath);
});
});
describe('langCodes', () => { describe('langCodes', () => {
it('is a list of all the language codes', () => { it('is a list of all the language codes', () => {
expect(langCodes.sort()).to.eql(listOfLocales); expect(langCodes.sort()).to.eql(listOfLocales);

View File

@@ -1,5 +1,6 @@
import setupNconf from '../../../../../website/src/libs/api-v3/setupNconf'; import setupNconf from '../../../../../website/src/libs/api-v3/setupNconf';
import path from 'path';
import nconf from 'nconf'; import nconf from 'nconf';
describe('setupNconf', () => { describe('setupNconf', () => {
@@ -19,7 +20,9 @@ describe('setupNconf', () => {
expect(nconf.argv).to.be.calledOnce; expect(nconf.argv).to.be.calledOnce;
expect(nconf.env).to.be.calledOnce; expect(nconf.env).to.be.calledOnce;
expect(nconf.file).to.be.calledOnce; expect(nconf.file).to.be.calledOnce;
expect(nconf.file).to.be.calledWithMatch('user', /\/config.json$/);
let regexString = `\\${path.sep}config.json$`;
expect(nconf.file).to.be.calledWithMatch('user', new RegExp(regexString));
}); });
it('sets IS_PROD variable', () => { it('sets IS_PROD variable', () => {