-
Notifications
You must be signed in to change notification settings - Fork 1
/
pnpm.test.js
37 lines (31 loc) · 1.18 KB
/
pnpm.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import initFixture from "./testutils/readFixture"
import findWorkspacePackages from "./src/findWorkspacePackages"
import buildPackageGraph from "./src/buildPackageGraph"
import findCycles from "./src/findCycles"
describe("pnpm findWorkspacePackages", () => {
it("finds workspace packages when explicitly declared", async () => {
initFixture("pnpm-default")
const workspaces = await findWorkspacePackages()
expect(workspaces).toStrictEqual(["example1/package.json", "example2/package.json"])
})
it("finds workspace packages declared with *", async () => {
initFixture("pnpm-star")
const workspaces = await findWorkspacePackages()
expect(workspaces).toStrictEqual([
"packages/example1/package.json",
"packages/example2/package.json",
])
})
it("finds workspace packages declared with **", async () => {
initFixture("pnpm-doublestar")
const workspaces = await findWorkspacePackages()
expect(workspaces.sort()).toStrictEqual(
[
"packages/backend/one/package.json",
"packages/backend/two/package.json",
"packages/frontend/one/package.json",
"packages/frontend/two/package.json",
].sort()
)
})
})