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
18 changes: 18 additions & 0 deletions __mocks__/@docusaurus/Link.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* eslint-disable react/prop-types */
import React from 'react';

// Mock Docusaurus Link component
const Link = ({
to,
href,
activeBasePath, // eslint-disable-line @typescript-eslint/no-unused-vars
activeBaseRegex, // eslint-disable-line @typescript-eslint/no-unused-vars
isNavLink, // eslint-disable-line @typescript-eslint/no-unused-vars
prependBaseUrlToHref, // eslint-disable-line @typescript-eslint/no-unused-vars
...props
}) => {
const destination = to || href || '';
return <a href={destination} {...props} />;
};

export default Link;
2 changes: 2 additions & 0 deletions __mocks__/@generated/codeTranslations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* eslint-disable */
export default {};
11 changes: 11 additions & 0 deletions __mocks__/@generated/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
title: 'Test site',
url: 'http://localhost',
baseUrl: '/',
customFields: {
trackJsToken: 'mock-token',
rudderstackKey: 'mock-key',
growthbookClientKey: 'mock-client-key',
growthbookDecryptionKey: 'mock-decryption-key',
},
};
18 changes: 18 additions & 0 deletions __mocks__/@generated/globalData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* eslint-env node */
module.exports = {
i18n: {
currentLocale: 'en',
locales: ['en', 'fr'],
defaultLocale: 'en',
localeConfigs: {
en: {
label: 'English',
direction: 'ltr',
},
fr: {
label: 'Français',
direction: 'ltr',
},
},
},
};
16 changes: 16 additions & 0 deletions __mocks__/@generated/i18n.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* eslint-env node */
module.exports = {
defaultLocale: 'en',
locales: ['en', 'fr'],
currentLocale: 'en',
localeConfigs: {
en: {
label: 'English',
direction: 'ltr',
},
fr: {
label: 'Français',
direction: 'ltr',
},
},
};
11 changes: 11 additions & 0 deletions __mocks__/@generated/site-metadata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-env node */
module.exports = {
siteConfig: {
title: 'Test Site',
tagline: 'Test tagline',
url: 'https://test.com',
baseUrl: '/',
projectName: 'test-project',
organizationName: 'test-org',
},
};
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = {
'@docusaurus/(ErrorBoundary|BrowserOnly|ComponentCreator|constants|ExecutionEnvironment|Head|Interpolate|isInternalUrl|Link|Noop|renderRoutes|router|Translate|use.*)':
'@docusaurus/core/lib/client/exports/$1',

'@generated/(.*)': '<rootDir>/.docusaurus/$1',
'@generated/(.*)': '<rootDir>/__mocks__/@generated/$1',

'@docusaurus/plugin-content-docs/client': '@docusaurus/plugin-content-docs/src/client/index.ts',
'@site/(.*)': '<rootDir>/$1',
Expand Down
Loading
Loading