Skip to content

Commit

Permalink
fix(repo): test util windows paths
Browse files Browse the repository at this point in the history
  • Loading branch information
shellscape committed Jan 4, 2020
1 parent 7b0364f commit cd78e01
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion util/test.js
Expand Up @@ -32,8 +32,10 @@ const testBundle = async (t, bundle, args = {}) => {
const { output } = await bundle.generate({ format: 'cjs' });
const [{ code }] = output;
const module = { exports: {} };
// as of 1/2/2020 Github Actions + Windows has changed in a way that we must now escape backslashes
const cwd = process.cwd().replace(/\\/g, '\\\\');
const params = ['module', 'exports', 'require', 't', ...Object.keys(args)].concat(
`process.chdir('${process.cwd()}'); let result;\n\n${code}\n\nreturn result;`
`process.chdir('${cwd}'); let result;\n\n${code}\n\nreturn result;`
);

// eslint-disable-next-line no-new-func
Expand Down

0 comments on commit cd78e01

Please sign in to comment.