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 lib/__tests__/build-files.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let outputAssetsFiles = [];

function generateSite() {
shell.cd('website');
shell.exec('yarn build');
shell.exec('yarn build', {silent: true});
}

function clearBuildFolder() {
Expand Down
3 changes: 2 additions & 1 deletion lib/server/__tests__/docs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ describe('getFile', () => {
fs.existsSync = jest.fn().mockReturnValue(true);
fs.readFileSync = jest.fn().mockImplementation(file => {
const fakePath = file.replace(process.cwd().replace(/website$/, ''), '');
return fakeContent[fakePath];
const normalizedPath = fakePath.replace(/\\/g, '/');
return fakeContent[normalizedPath];
});

test('docs does not exist', () => {
Expand Down
4 changes: 3 additions & 1 deletion lib/server/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ function getSubDir(file, refDir) {
}

function getLanguage(file, refDir) {
const separator = escapeStringRegexp(path.sep);
const baseDir = escapeStringRegexp(path.basename(refDir));
const regexSubFolder = new RegExp(
`${escapeStringRegexp(path.basename(refDir))}/(.*?)/.*`
`${baseDir}${separator}(.*?)${separator}.*`
);
const match = regexSubFolder.exec(file);

Expand Down