Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 82063e2

Browse files
committed
chore: add unit tests
1 parent 571c7f2 commit 82063e2

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Diff for: index.spec.ts

+15-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe('index', () => {
6161
path.join = originalPathJoin;
6262
});
6363

64-
it('returns RegExp that matches Windows', () => {
64+
it('returns RegExp that works with Windows paths', () => {
6565
const appPath = "D:\\Work\\app1\\app";
6666
path.join = path.win32.join;
6767
const regExp = getEntryPathRegExp(appPath, entryModule);
@@ -74,5 +74,19 @@ describe('index', () => {
7474
const regExp = getEntryPathRegExp(appPath, entryModule);
7575
expect(!!regExp.exec(`${appPath}/${entryModule}`)).toBe(true);
7676
});
77+
78+
it('returns RegExp that works with Windows paths with special symbol in path', () => {
79+
const appPath = "D:\\Work\\app1\\app (2)";
80+
path.join = path.win32.join;
81+
const regExp = getEntryPathRegExp(appPath, entryModule);
82+
expect(!!regExp.exec(`${appPath}\\${entryModule}`)).toBe(true);
83+
});
84+
85+
it('returns RegExp that works with POSIX paths with special symbol in path', () => {
86+
const appPath = "/usr/local/lib/app1/app (2)";
87+
path.join = path.posix.join;
88+
const regExp = getEntryPathRegExp(appPath, entryModule);
89+
expect(!!regExp.exec(`${appPath}/${entryModule}`)).toBe(true);
90+
});
7791
});
7892
});

0 commit comments

Comments
 (0)