Skip to content

Commit

Permalink
Fix test import path for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ccampbell committed Jun 15, 2018
1 parent b2ece01 commit 29c9792
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ let runOptions;
export async function getBundle(filePath, options) {
return new Promise(async(resolve, reject) => {
try {
// This is somewhat confusing, but on Windows since this is a
// straight string replacement any path that has \test\something in
// it will end up rendering the \t as a tab characters. We have to
// make sure that any \ are replaced with \\
const fullTestPath = path.join(process.cwd(), filePath).replace(/\\/g, '\\\\');
const plugins = [
replace({
TEST_FILE_PATH: path.join(process.cwd(), filePath),
TEST_FILE_PATH: fullTestPath,
TEST_TIMEOUT: options.timeout
}),
buble({
Expand Down

0 comments on commit 29c9792

Please sign in to comment.