Skip to content

Commit

Permalink
test: refactor tests of toFormatters
Browse files Browse the repository at this point in the history
Signed-off-by: Rong Sen Ng (motss) <[email protected]>
  • Loading branch information
motss committed Jan 6, 2024
1 parent 00aefa6 commit 275abae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/__tests__/helpers/to-formatters.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { expect } from '@open-wc/testing';
import { describe, expect, it } from 'vitest';

import { toFormatters } from '../../helpers/to-formatters';
import type { Formatters } from '../../typings';

describe(toFormatters.name, () => {
it('returns formatters', () => {
const testLocale = 'en-US';
const result = toFormatters(testLocale);
const locale = 'en-US';
const result = toFormatters(locale);

expect(result).haveOwnProperty('locale', testLocale);
expect(result).toHaveProperty('locale', locale);

const props: (keyof Omit<Formatters, 'locale'>)[] = [
'dateFormat',
Expand All @@ -23,7 +23,7 @@ describe(toFormatters.name, () => {

props.forEach(
n =>
expect(result).haveOwnProperty(n)
expect(result).toHaveProperty(n)
);
});

Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default defineConfig({
'**/*test*/helpers/to-closest-target.test.ts',
'**/*test*/helpers/to-date-string.test.ts',
'**/*test*/helpers/to-day-diff-inclusive.test.ts',
'**/*test*/helpers/to-formatters.test.ts',
// '**/*test*/date-picker-input/**.test.ts',
],
clearMocks: true,
Expand Down

0 comments on commit 275abae

Please sign in to comment.