-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(repository-tools): add sub-path exports
Enable importing specific functions, e.g. ```ts import { findRootSync } from "@altano/repository-tools/findRootSync"; ```
- Loading branch information
Showing
5 changed files
with
37 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@altano/repository-tools": minor | ||
--- | ||
|
||
Enable importing specific functions |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import path from "node:path"; | ||
import { describe, expect, it } from "vitest"; | ||
import { findRoot } from "@altano/repository-tools/findRoot"; | ||
import { findRootSync } from "@altano/repository-tools/findRootSync"; | ||
|
||
// Test sub-path exports separately by importing using the package name. This | ||
// has to be separate from other tests because vitest test coverage analysis | ||
// doesn't understand what code this is testing. | ||
|
||
describe("sub-path exports", function () { | ||
it("find this repository's root asynchronously", async () => { | ||
const repoRoot = path.resolve(import.meta.dirname, "..", "..", "..", ".."); | ||
expect(await findRoot(import.meta.dirname)).toEqual(repoRoot); | ||
}); | ||
it("find this repository's root synchronously", () => { | ||
const repoRoot = path.resolve(import.meta.dirname, "..", "..", "..", ".."); | ||
expect(findRootSync(import.meta.dirname)).toEqual(repoRoot); | ||
}); | ||
}); |
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