Skip to content

Commit a53696d

Browse files
authored
test: stable tests cross os (#241)
1 parent 6bf613d commit a53696d

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

test/bunCatalog.test.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ describe('bun catalog integration', () => {
7272
expect(
7373
result.packages.flatMap(p => ({
7474
name: p.name,
75-
packages: p.resolved.map(r => [r.name, r.targetVersion]),
75+
packages: p.resolved
76+
.map(r => [r.name, r.targetVersion])
77+
.sort((a, b) => a[0].localeCompare(b[0])),
7678
})),
7779
).toMatchInlineSnapshot(`
7880
[
@@ -118,6 +120,10 @@ describe('bun catalog integration', () => {
118120
{
119121
"name": "@taze/bun-monorepo-example",
120122
"packages": [
123+
[
124+
"@types/lodash",
125+
"^4.14.0",
126+
],
121127
[
122128
"express",
123129
"4.12.x",
@@ -134,18 +140,14 @@ describe('bun catalog integration', () => {
134140
"react-bootstrap",
135141
"^0.22.6",
136142
],
137-
[
138-
"webpack",
139-
"~1.9.10",
140-
],
141-
[
142-
"@types/lodash",
143-
"^4.14.0",
144-
],
145143
[
146144
"typescript",
147145
"3.5",
148146
],
147+
[
148+
"webpack",
149+
"~1.9.10",
150+
],
149151
],
150152
},
151153
]

test/pnpmCatalog.test.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ it('pnpm catalog', async () => {
4444
expect(
4545
result.packages.flatMap(p => ({
4646
name: p.name,
47-
packages: p.resolved.map(r => [r.name, r.targetVersion]),
47+
packages: p.resolved
48+
.map(r => [r.name, r.targetVersion])
49+
.sort((a, b) => a[0].localeCompare(b[0])),
4850
})),
4951
).toMatchInlineSnapshot(`
5052
[
@@ -99,6 +101,10 @@ it('pnpm catalog', async () => {
99101
{
100102
"name": "@taze/monorepo-example",
101103
"packages": [
104+
[
105+
"@types/lodash",
106+
"^4.14.0",
107+
],
102108
[
103109
"express",
104110
"4.12.x",
@@ -115,18 +121,14 @@ it('pnpm catalog', async () => {
115121
"react-bootstrap",
116122
"^0.22.6",
117123
],
118-
[
119-
"webpack",
120-
"~1.9.10",
121-
],
122-
[
123-
"@types/lodash",
124-
"^4.14.0",
125-
],
126124
[
127125
"typescript",
128126
"3.5",
129127
],
128+
[
129+
"webpack",
130+
"~1.9.10",
131+
],
130132
],
131133
},
132134
]

0 commit comments

Comments
 (0)