diff --git a/test/path-join.spec.js b/test/path-join.spec.js index b2c39ad..40e7a7d 100644 --- a/test/path-join.spec.js +++ b/test/path-join.spec.js @@ -1,11 +1,13 @@ import { equal } from 'assert' import Path from 'path' -import { join, posixJoin, win32Join } from '../src/utils/path-join.js' +import { posixJoin, win32Join } from '../src/utils/path-join.js' const platform = process.platform const createTestData = s => [ - [s], + [], + [''], + [s], [s, 'test'], ['test'], ['test', s], @@ -14,7 +16,11 @@ const createTestData = s => [ [`test${s}`, s, `${s}${s}`, `${s}a`], [`test${s}`, '.', `${s}a`], [`test${s}.${s}a`], - ['test', s, '.', s] + ['test', s, '.', s], + ['/test', '\\', 'mixed'], + ['\\test', '/', 'mixed'], + ['test', '/', 'mixed', '\\', 'data'], + ['test', '\\', 'mixed', '/', 'data'] ] const posixTestData = createTestData('/') @@ -62,13 +68,13 @@ describe('Path join on win32', () => { it('gives the same results as Path using posix paths', () => { for (const data of posixTestData) { - equal(Path.win32.join(...data), join(...data)) + equal(Path.join(...data), join(...data)) } }) it('gives the same results as Path using win32 paths', () => { for (const data of win32TestData) { - equal(Path.win32.join(...data), join(...data)) + equal(Path.join(...data), join(...data)) } }) }) @@ -87,13 +93,13 @@ describe('Path join on posix', () => { it('gives the same results as Path using posix paths', () => { for (const data of posixTestData) { - equal(Path.posix.join(...data), join(...data)) + equal(Path.join(...data), join(...data)) } }) it('gives the same results as Path using win32 paths', () => { for (const data of win32TestData) { - equal(Path.posix.join(...data), join(...data)) + equal(Path.join(...data), join(...data)) } }) })