|
1 |
| -import { getMatchPortion } from '../../src/utils/get-relative-path' |
| 1 | +import { getMatchPortion } from "../../src/utils/get-relative-path"; |
2 | 2 |
|
3 | 3 | describe(`getMatchPortion`, () => {
|
4 |
| - it("works in a simple case", () => { |
5 |
| - expect(getMatchPortion("/foo/bar", "/foo/quux")).toBe("/foo/"); |
6 |
| - }); |
| 4 | + it("works in a simple case", () => { |
| 5 | + expect(getMatchPortion("/foo/bar", "/foo/quux")).toBe("/foo/"); |
| 6 | + }); |
7 | 7 |
|
8 |
| - // We use the function getMatchPortion to generate a new path for “to”, so let’s preserve |
9 |
| - // the case where possible. |
10 |
| - // Otherwise we are introducing inconsistency for our users, who may have had import from Foo, |
11 |
| - // their file is named Foo, but we rewrite the path to foo. |
12 |
| - // Although the file is still accessible in the file system, other tools might reasonably |
13 |
| - // complain about the unexpected case mismatch. |
14 |
| - it("prioritizes the casing of the “to” parameter", () => { |
15 |
| - expect(getMatchPortion("/foo/bar", "/foO/quux")).toBe("/foO/"); |
16 |
| - expect(getMatchPortion("/foo/bar", "/foo/Bonk")).toBe("/foo/B"); |
17 |
| - }); |
| 8 | + // We use the function getMatchPortion to generate a new path for “to”, so let’s preserve |
| 9 | + // the case where possible. |
| 10 | + // Otherwise we are introducing inconsistency for our users, who may have had import from Foo, |
| 11 | + // their file is named Foo, but we rewrite the path to foo. |
| 12 | + // Although the file is still accessible in the file system, other tools might reasonably |
| 13 | + // complain about the unexpected case mismatch. |
| 14 | + it("prioritizes the casing of the “to” parameter", () => { |
| 15 | + expect(getMatchPortion("/foo/bar", "/foO/quux")).toBe("/foO/"); |
| 16 | + expect(getMatchPortion("/foo/bar", "/foo/Bonk")).toBe("/foo/B"); |
| 17 | + }); |
18 | 18 | });
|
0 commit comments