diff --git a/jest.config.ts b/jest.config.ts index b0fe784f..49abaefb 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -1,8 +1,10 @@ import type {Config} from '@jest/types'; const cfg: Config.InitialOptions = { + verbose: true, preset: 'ts-jest', testEnvironment: 'jsdom', + modulePathIgnorePatterns: ['/build/', '/node_modules/'], }; export default cfg; diff --git a/src/libs/settings/__tests__/settings.test.ts b/src/libs/settings/__tests__/settings.test.ts new file mode 100644 index 00000000..895640e6 --- /dev/null +++ b/src/libs/settings/__tests__/settings.test.ts @@ -0,0 +1,8 @@ +import {DEFAULT_LOCALE_SPECIFICATION, settings} from '../settings'; + +describe('libs/settings', () => { + it('Default locale should be equal DEFAULT_LOCALE_SPECIFICATION', () => { + const result = settings.get('locale'); + expect(result).toBe(DEFAULT_LOCALE_SPECIFICATION); + }); +}); diff --git a/src/libs/settings/settings.ts b/src/libs/settings/settings.ts index 72067bdd..042959e1 100644 --- a/src/libs/settings/settings.ts +++ b/src/libs/settings/settings.ts @@ -9,7 +9,7 @@ type Settings = { }; type SettingKey = keyof Settings; -const DEFAULT_LOCALE_SPECIFICATION: moment.LocaleSpecification = {week: {dow: 1, doy: 7}}; +export const DEFAULT_LOCALE_SPECIFICATION: moment.LocaleSpecification = {week: {dow: 1, doy: 7}}; const removeUndefinedValues = >(data: T) => { return Object.entries(data).reduce((acc, [key, value]) => {