generated from anolilab/monorepo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: added correct resolution for isolated declarations
- Loading branch information
Showing
15 changed files
with
225 additions
and
39 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
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
45 changes: 45 additions & 0 deletions
45
...ackem/__tests__/unit/rollup/plugins/isolated-declarations/split-tsconfig-path-key.test.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { describe, expect, it } from "vitest"; | ||
|
||
import splitTsconfigPathKey from "../../../../../src/rollup/plugins/isolated-declarations/split-tsconfig-path-key"; | ||
|
||
describe("splitTsconfigPathKey", () => { | ||
it("should split a simple path", () => { | ||
expect.assertions(1); | ||
|
||
const result = splitTsconfigPathKey("src/utils/*"); | ||
|
||
expect(result).toEqual(["src", "utils", "*"]); | ||
}); | ||
|
||
it("should split a namespaced path", () => { | ||
expect.assertions(1); | ||
|
||
const result = splitTsconfigPathKey("@namespace:module/utils/*"); | ||
|
||
expect(result).toEqual(["@namespace:module", "utils", "*"]); | ||
}); | ||
|
||
it("should handle a wildcard-only path", () => { | ||
expect.assertions(1); | ||
|
||
const result = splitTsconfigPathKey("*"); | ||
|
||
expect(result).toEqual(["*"]); | ||
}); | ||
|
||
it("should handle a namespaced path without wildcard", () => { | ||
expect.assertions(1); | ||
|
||
const result = splitTsconfigPathKey("@namespace:module/utils"); | ||
|
||
expect(result).toEqual(["@namespace:module", "utils"]); | ||
}); | ||
|
||
it("should throw an error for invalid input", () => { | ||
expect.assertions(3); | ||
|
||
expect(() => splitTsconfigPathKey("")).toThrow("Invalid key: Key must be a non-empty string."); | ||
expect(() => splitTsconfigPathKey(null as any)).toThrow("Invalid key: Key must be a non-empty string."); | ||
expect(() => splitTsconfigPathKey(undefined as any)).toThrow("Invalid key: Key must be a non-empty string."); | ||
}); | ||
}); |
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
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
Oops, something went wrong.