|
1 |
| -import { getConvertedExternals, getEntryPathRegExp } from './index'; |
2 |
| -const path = require("path"); |
| 1 | +import { getConvertedExternals } from './index'; |
3 | 2 |
|
4 | 3 | describe('index', () => {
|
5 | 4 | describe('getConvertedExternals', () => {
|
@@ -52,41 +51,4 @@ describe('index', () => {
|
52 | 51 | });
|
53 | 52 | });
|
54 | 53 | });
|
55 |
| - |
56 |
| - describe('getEntryPathRegExp', () => { |
57 |
| - const originalPathJoin = path.join; |
58 |
| - const entryModule = "index.js"; |
59 |
| - |
60 |
| - afterEach(() => { |
61 |
| - path.join = originalPathJoin; |
62 |
| - }); |
63 |
| - |
64 |
| - it('returns RegExp that works with Windows paths', () => { |
65 |
| - const appPath = "D:\\Work\\app1\\app"; |
66 |
| - path.join = path.win32.join; |
67 |
| - const regExp = getEntryPathRegExp(appPath, entryModule); |
68 |
| - expect(!!regExp.exec(`${appPath}\\${entryModule}`)).toBe(true); |
69 |
| - }); |
70 |
| - |
71 |
| - it('returns RegExp that works with POSIX paths', () => { |
72 |
| - const appPath = "/usr/local/lib/app1/app"; |
73 |
| - path.join = path.posix.join; |
74 |
| - const regExp = getEntryPathRegExp(appPath, entryModule); |
75 |
| - expect(!!regExp.exec(`${appPath}/${entryModule}`)).toBe(true); |
76 |
| - }); |
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 |
| - }); |
91 |
| - }); |
92 | 54 | });
|
0 commit comments