You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: In the Codecademy Docs Content - adheres to content file structure test the split doesn't correctly split for Window users. On Mac the / is the separator whereas on windows its \\. So when running the tests on windows the test fails and doesn't split up 'nodePath' variable correctly.
Description: In the
Codecademy Docs Content - adheres to content file structure
test the split doesn't correctly split for Window users. On Mac the/
is the separator whereas on windows its\\
. So when running the tests on windows the test fails and doesn't split up 'nodePath' variable correctly.Affected file: https://github.com/Codecademy/docs/blob/main/content.test.ts
Expected: line 53:
const nodeName = nodePath.split('/').slice(-1)[0];
to be 'c'Actual: line 53:
const nodeName = nodePath.split('/').slice(-1)[0];
is 'C:\\Users\\USERNAME\\Documents\\codecademydocs\\content\\c'Suggested change: instead of splitting using
/
, usepath.sep
(see https://nodejs.org/api/path.html#path_path_sep)For example line 53 becomes:
const nodeName = nodePath.split(path.sep).slice(-1)[0];
this will fixfor windows or mac users when running test locally@sonnynomnom
The text was updated successfully, but these errors were encountered: