Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"lint": "turbo run lint:md lint:snippets lint:js lint:css",
"lint:fix": "turbo run lint:md lint:js lint:css --no-cache -- --fix",
"sync-orama": "node ./scripts/orama-search/sync-orama-cloud.mjs",
"test:unit": "cross-env NODE_NO_WARNINGS=1 node --experimental-test-coverage --test-coverage-exclude=**/*.test.* --experimental-test-module-mocks --enable-source-maps --import=global-jsdom/register --import=tsx --import=tests/setup.mjs --test **/*.test.*",
"test:unit": "cross-env NODE_NO_WARNINGS=1 node --experimental-test-coverage --test-coverage-exclude=**/*.test.* --experimental-test-module-mocks --enable-source-maps --import=global-jsdom/register --import=tsx --import=tests/setup.jsx --test **/*.test.*",
"test:unit:watch": "cross-env NODE_OPTIONS=\"--watch\" npm run test:unit",
"test": "turbo test:unit"
},
Expand Down
37 changes: 0 additions & 37 deletions apps/site/tests/loader.mjs

This file was deleted.

16 changes: 0 additions & 16 deletions apps/site/tests/mocks/next-intl.jsx

This file was deleted.

6 changes: 0 additions & 6 deletions apps/site/tests/mocks/next-router.mjs

This file was deleted.

28 changes: 28 additions & 0 deletions apps/site/tests/setup.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// We import this file before the root setup.mjs, so React is not automatically imported
import * as React from 'react';

import { mock } from 'node:test';

import '../../../tests/setup.mjs';

mock.module('next-intl', {
namedExports: {
useTranslations: () => key => key,

useFormatter: () => {
const formatWith = format => new Intl.DateTimeFormat('en-US', format);
return {
date: (date, format) => formatWith(format).format(date),
dateTime: (date, format) => formatWith(format).format(date),
};
},
},
});

mock.module('next-intl/navigation', {
namedExports: {
createNavigation: () => ({
Link: props => <a {...props} onClick={e => e.preventDefault()} />,
}),
},
});
5 changes: 0 additions & 5 deletions apps/site/tests/setup.mjs

This file was deleted.

Loading