|
1 | 1 | import test from 'ava'; |
| 2 | +import isPromise from 'is-promise'; |
2 | 3 | import outResolve from '../src/out-resolve'; |
3 | 4 |
|
4 | 5 | test('should return function', t => { |
5 | 6 | t.true(typeof outResolve === 'function'); |
6 | 7 | }); |
7 | 8 |
|
8 | | -test('only input should return file.ext', t => { |
9 | | - t.is(outResolve('file.ext'), 'file.ext'); |
| 9 | +test('should return Promise', t => { |
| 10 | + t.true(isPromise(outResolve())); |
10 | 11 | }); |
11 | 12 |
|
12 | | -test('only input should return tmp/file.ext', t => { |
13 | | - t.is(outResolve('tmp/file.ext'), 'tmp/file.ext'); |
| 13 | +test('only input should return file.ext', async t => { |
| 14 | + t.is(await outResolve('file.ext'), 'file.ext'); |
14 | 15 | }); |
15 | 16 |
|
16 | | -test('input file and output file should return output.ext', t => { |
17 | | - t.is(outResolve('file.ext', 'output.ext'), 'output.ext'); |
| 17 | +test('only input should return tmp/file.ext', async t => { |
| 18 | + t.is(await outResolve('tmp/file.ext'), 'tmp/file.ext'); |
18 | 19 | }); |
19 | 20 |
|
20 | | -test('input file and output folder should return tmp/file.ext', t => { |
21 | | - t.is(outResolve('file.ext', 'tmp'), 'tmp/file.ext'); |
| 21 | +test('input file and output file should return output.ext', async t => { |
| 22 | + t.is(await outResolve('file.ext', 'output.ext'), 'output.ext'); |
22 | 23 | }); |
23 | 24 |
|
24 | | -test('input files and output folder should return tmp/test/*.ext', t => { |
25 | | - t.is(outResolve('test/*.ext', 'tmp'), 'tmp/test/*.ext'); |
| 25 | +test('input file and output folder should return tmp/file.ext', async t => { |
| 26 | + t.is(await outResolve('file.ext', 'tmp'), 'tmp/file.ext'); |
26 | 27 | }); |
27 | 28 |
|
28 | | -test('input files and output file should return output.ext', t => { |
29 | | - t.is(outResolve('test/*', 'output.ext'), 'output.ext'); |
| 29 | +test('input files and output folder should return tmp/test/*.ext', async t => { |
| 30 | + t.is(await outResolve('test/*.ext', 'tmp'), 'tmp/test/*.ext'); |
30 | 31 | }); |
31 | 32 |
|
32 | | -test('input files and output file should return tmp/output.ext', t => { |
33 | | - t.is(outResolve('test/*', 'tmp/output.ext'), 'tmp/output.ext'); |
| 33 | +test('input files and output file should return output.ext', async t => { |
| 34 | + t.is(await outResolve('test/*', 'output.ext'), 'output.ext'); |
| 35 | +}); |
| 36 | + |
| 37 | +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'); |
34 | 39 | }); |
35 | 40 |
|
0 commit comments