Skip to content

Commit

Permalink
test: add server specific test to site locale
Browse files Browse the repository at this point in the history
  • Loading branch information
logaretm committed Aug 17, 2024
1 parent e20a4ed commit cf29dda
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/core/src/constants/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { FieldTypePrefixes } from '.';
import { FieldTypePrefixes, NOOP } from '.';

test('Field Prefixes are unique', () => {
const prefixes = Object.values(FieldTypePrefixes);
const uniquePrefixes = new Set(prefixes);

expect(uniquePrefixes.size).toBe(prefixes.length);
});

test('NOOP does nothing', () => {
expect(NOOP.length).toBe(0);
expect(NOOP()).toBeUndefined();
});
8 changes: 8 additions & 0 deletions packages/core/src/i18n/getSiteLocale.server.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @vitest-environment node
import { getSiteLocale } from './getSiteLocale';
import { expect } from 'vitest';

test('test', () => {
expect(typeof window).toBe('undefined');
expect(getSiteLocale()).toBe('en-US');
});

0 comments on commit cf29dda

Please sign in to comment.