Fix Jest tests that fail on Windows (#896)

* Fix failing tests

* Suppress build output in build tests
This commit is contained in:
Tom Auger 2018-08-10 16:21:52 +01:00 committed by Endilie Yacop Sucipto
parent e27e18bd63
commit 3f896c8e18
3 changed files with 6 additions and 3 deletions

View file

@ -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);