Skip to content

Commit

Permalink
Use cross-platform path.join to handle creating file paths on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
negativetwelve committed Nov 9, 2017
1 parent 6a819c6 commit 33adaea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/jest-plugin-fs/src/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {fs as mockFs, vol} from 'memfs';
* We allow passing in a nested object of paths. This function combines the
* paths into a single flattened object of absolute path -> content.
*/
const flatten = (root, object) => {
const accumulate = (all, [path, value]) => {
const fullPath = `${root}/${path}`;
const flatten = (fsRoot, object) => {
const accumulate = (all, [currentPath, value]) => {
const fullPath = path.join(fsRoot, currentPath);

if (typeof value === 'string') {
return {
Expand Down

0 comments on commit 33adaea

Please sign in to comment.