Merge branch 'tests/add-tests' of https://github.com/ajnart/homarr into tests/add-tests

This commit is contained in:
Manuel
2023-03-29 12:42:51 +02:00
2 changed files with 4 additions and 12 deletions

View File

@@ -6,19 +6,13 @@ export const getServerSideTranslations = async (
namespaces: string[],
requestLocale?: string,
req?: IncomingMessage,
res?: ServerResponse,
res?: ServerResponse
) => {
if (!req || !res) {
return serverSideTranslations(
requestLocale ?? 'en',
namespaces
);
return serverSideTranslations(requestLocale ?? 'en', namespaces);
}
const configLocale = getCookie('config-locale', { req, res });
return serverSideTranslations(
(configLocale ?? requestLocale ?? 'en') as string,
namespaces
);
return serverSideTranslations((configLocale ?? requestLocale ?? 'en') as string, namespaces);
};

View File

@@ -13,8 +13,6 @@ export default defineConfig({
all: true,
exclude: ['.next/', '.yarn/', 'data/'],
},
setupFiles: [
'./tests/setupVitest.ts',
],
setupFiles: ['./tests/setupVitest.ts'],
},
});