Skip to content

Commit 3531e1b

Browse files
committed
chore: add theme mock for tests
1 parent 955bee6 commit 3531e1b

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Stub for the #theme/config virtual module used in tests.
2+
export const useAbsoluteURLs = false;
3+
export const baseURL = 'https://nodejs.org/';
4+
export const project = 'Node.js';
5+
export const repository = 'nodejs/node';
6+
export const title = 'Node.js';
7+
export const version = 'v22.0.0';
8+
export const versions = [];
9+
export const pages = [];
10+
export const editURL = '';
11+
export const languageDisplayNameMap = new Map();
12+
export const input = '';
13+
export const ignore = [];
14+
export const output = '';
15+
export const minify = false;
16+
export const ref = '';
17+
export const templatePath = '';

src/generators/web/ui/components/SideBar/utils/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { relativeOrAbsolute } from '../../utils/relativeOrAbsolute.mjs';
1+
import { relativeOrAbsolute } from '../../../utils/relativeOrAbsolute.mjs';
22

33
/**
44
* Builds grouped sidebar navigation from categorized page entries.

src/generators/web/ui/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"sideEffects": false
2+
"sideEffects": false,
3+
"imports": {
4+
"#theme/config": "./__mocks__/theme-config.mjs"
5+
}
36
}

0 commit comments

Comments
 (0)