Skip to content

Commit 70c0936

Browse files
committed
test: normalize path, close #279
1 parent 692272f commit 70c0936

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"@babel/register": "^7.4.0",
5252
"@commitlint/cli": "^7.5.2",
5353
"@commitlint/config-angular": "^7.5.0",
54+
"acorn": "^6.1.1",
5455
"ava": "*",
5556
"babel-eslint": "^10.0.1",
5657
"babel-preset-minify": "^0.5.0",

test/test-out-resolve.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import path from 'path';
12
import test from 'ava';
23
import isPromise from 'is-promise';
34
import outResolve from '../lib/out-resolve';
@@ -15,26 +16,26 @@ test('only input should return file.ext', async t => {
1516
});
1617

1718
test('only input should return tmp/file.ext', async t => {
18-
t.is(await outResolve('tmp/file.ext'), 'tmp/file.ext');
19+
t.is(await outResolve('tmp/file.ext'), path.normalize('tmp/file.ext'));
1920
});
2021

2122
test('input file and output file should return output.ext', async t => {
2223
t.is(await outResolve('file.ext', 'output.ext'), 'output.ext');
2324
});
2425

2526
test('input file and output folder should return tmp/file.ext', async t => {
26-
t.is(await outResolve('file.ext', 'tmp'), 'tmp/file.ext');
27+
t.is(await outResolve('file.ext', 'tmp'), path.normalize('tmp/file.ext'));
2728
});
2829

2930
test('input files and output folder should return tmp/test/*.ext', async t => {
30-
t.is(await outResolve('test/*.ext', 'tmp'), 'tmp/test/*.ext');
31+
t.is(await outResolve('test/*.ext', 'tmp'), path.normalize('tmp/test/*.ext'));
3132
});
3233

3334
test('input files and output file should return output.ext', async t => {
3435
t.is(await outResolve('test/*', 'output.ext'), 'output.ext');
3536
});
3637

3738
test('input files and output file should return tmp/output.ext', async t => {
38-
t.is(await outResolve('test/*', 'tmp/output.ext'), 'tmp/output.ext');
39+
t.is(await outResolve('test/*', 'tmp/output.ext'), path.normalize('tmp/output.ext'));
3940
});
4041

0 commit comments

Comments
 (0)