From e8abb7e966547ad0350214de312ea4653e18e799 Mon Sep 17 00:00:00 2001 From: Patrik Henningsson Date: Mon, 22 Aug 2016 16:49:25 +0200 Subject: [PATCH] Force forward slashes in paths --- lib/tree.js | 2 ++ package.json | 2 +- test/api.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/tree.js b/lib/tree.js index c8683158..2d39cea9 100644 --- a/lib/tree.js +++ b/lib/tree.js @@ -172,6 +172,8 @@ class Tree { absPath = absPath.replace(/\.\w+$/, ''); } + absPath = absPath.replace(/\\/g, '/'); + return absPath; } diff --git a/package.json b/package.json index 487c5ac5..f2aa88af 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "mocha": "mocha test/*.js", "watch": "mocha --watch --growl test/*.js", "lint": "eslint bin/cli.js lib test/*.js", - "debug": "bin/cli.js --debug bin lib", + "debug": "node bin/cli.js --debug bin lib", "generate": "npm run generate:small && npm run generate:madge", "generate:small": "bin/cli.js --image /tmp/simple.svg test/files/cjs/circular/a.js", "generate:madge": "bin/cli.js --image /tmp/madge.svg bin lib" diff --git a/test/api.js b/test/api.js index af3ae414..98ce24d8 100644 --- a/test/api.js +++ b/test/api.js @@ -150,7 +150,7 @@ describe('Madge', () => { madge(__dirname + '/files/cjs/a.js', {graphVizPath: '/invalid/path'}) .then((res) => res.image('image.png')) .catch((err) => { - err.message.should.eql('Could not execute /invalid/path/gvpr -V'); + err.message.should.match(/Could not execute .*gvpr \-V/); done(); }); });