./mach npm test --prefix=browser/components/newtab fails on windows, for the following scripts:
"lint:codespell": "(cd $npm_package_config_mc_root && ./mach lint -l codespell $npm_package_config_newtab_path)",
"lint:eslint": "(cd $npm_package_config_mc_root && ./mach lint -l eslint $npm_package_config_newtab_path)",
"lint:l10n": "(cd $npm_package_config_mc_root && ./mach lint -l l10n --warnings browser/locales/en-US/browser/newtab)",
"lint:license": "(cd $npm_package_config_mc_root && ./mach lint -l license $npm_package_config_newtab_path)",
There are two issues:
(1) Variable substitution
npm test uses Windows command prompt style command invocation,
%foo% instead of
$foo for variable substitution.
So it tries to cd to literally
$npm_package_config_mc_root directory and fails.
(2) Command invocation
Even if the variable substitution is fixed by replacing them with raw value,
it still fails because
/ is treated as delimiter between command and parameter, instead of directory separator,
and it tries to execute
. as command.
Then given that it doesn't use msys shell anyway, I think
mach command doesn't work there,
and we need to at least mention that npm test doesn't work on windows, in the document.