Skip to content

Commit

Permalink
test: Fix failing tests for createGetPublicPath on windows(path compare)
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-suhas committed Jul 6, 2017
1 parent 33482a0 commit 52227c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"eslint-plugin-react": "^7.1.0",
"faucet": "^0.0.1",
"recursive-readdir": "^2.2.1",
"slash": "^1.0.0",
"spy": "^1.0.0",
"tape": "^4.7.0"
},
Expand Down
11 changes: 6 additions & 5 deletions specs/createGetPublicPath.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import test from 'tape';
import slash from 'slash';
import { createGetPublicPath } from '../src/paths';

test('createGetPublicPath: should return publicPath path currently', (tt) => {
Expand All @@ -8,7 +9,7 @@ test('createGetPublicPath: should return publicPath path currently', (tt) => {
const getPublicPath = createGetPublicPath(compilerOptions, dllPath);

const expected = '/base/dllPath/filename.js';
tt.equals(getPublicPath(filename), expected);
tt.equals(slash(getPublicPath(filename)), expected);
tt.end();
});

Expand All @@ -19,18 +20,18 @@ test('createGetPublicPath: should return relative path currently when relative =
const getPublicPath = createGetPublicPath(compilerOptions, dllPath);

const expected = 'dllPath/filename.js';
tt.equals(getPublicPath(filename, true), expected);
tt.equals(slash(getPublicPath(filename, true)), expected);
tt.end();
});

test('createGetPublicPath: without compiler.options.publicPath', (t) => {
const compilerOptions = { output: {} };
const compilerOptions = { output: {} };
const dllPath = './dllPath';
const filename = 'filename.js';
const getPublicPath = createGetPublicPath(compilerOptions, dllPath);

const expected = 'dllPath/filename.js';

t.equals(getPublicPath(filename), expected);
t.equals(slash(getPublicPath(filename)), expected);
t.end();
});
});

0 comments on commit 52227c5

Please sign in to comment.