This repository has been archived by the owner on Jan 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add
strip-leading-paths
option (#283)
- Loading branch information
1 parent
f9c8a9b
commit 0d8f59a
Showing
6 changed files
with
92 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { join } from "path"; | ||
import { getDest } from "../util"; | ||
|
||
describe("getDest", () => { | ||
it("does not modify the filename by default", () => { | ||
expect( | ||
getDest(join(process.cwd(), "src/path/name.ts"), "foo/bar", false) | ||
).toEqual("foo/bar/src/path/name.ts"); | ||
}); | ||
|
||
it("when stripLeadingPaths is true, it removes leading paths", () => { | ||
expect( | ||
getDest(join(process.cwd(), "src/path/name.ts"), "foo/bar", true) | ||
).toEqual("foo/bar/path/name.ts"); | ||
}); | ||
|
||
it("when stripLeadingPaths is true, it also resolves relative paths", () => { | ||
expect( | ||
getDest(join(process.cwd(), "../../path/name.ts"), "foo/bar", true) | ||
).toEqual("foo/bar/path/name.ts"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters