-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85314dd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test are failing because of
const env = require('./env.js');
resolves differently in jest (it becomestest/env
instead ofserver/env
)One solution is to mock the relative path or code split the env require inside getLanguage function
85314dd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realized that too, but seems so troublesome. Sigh this path thingy is so annoying.
85314dd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm gonna take a break from Docusaurus for today. Had enough of head banging for the day 😂
85314dd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hahaha. I think its more of because we dont use something like webpack. All the dependency path must be manually taken care by us
85314dd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's one of the reason. Another thing to improve on is that we should have a utility that retrieves the siteConfig file regardless of CWD. Jest, ESLint, Babel (any tool that relies on a config) all have some sort of config retrieval code. With that we can stop relying on CWD.