Skip to content

Commit

Permalink
test: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zkochan committed May 18, 2024
1 parent 10063fe commit 479d4fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions packages/calc-dep-state/test/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { calcDepState } from '@pnpm/calc-dep-state'
import { ENGINE_NAME } from '@pnpm/constants'
import { hashObject } from '@pnpm/crypto.object-hasher'
import { type PkgId } from '@pnpm/types'

const depsGraph = {
'registry/foo@1.0.0': {
depPath: 'foo@1.0.0',
packageId: 'foo@1.0.0' as PkgId,
children: {
bar: 'registry/bar@1.0.0',
},
},
'registry/bar@1.0.0': {
depPath: 'bar@1.0.0',
packageId: 'bar@1.0.0' as PkgId,
children: {
foo: 'registry/foo@1.0.0',
},
Expand Down
13 changes: 7 additions & 6 deletions packages/calc-dep-state/test/lockfileToDepGraph.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { lockfileToDepGraph } from '@pnpm/calc-dep-state'
import { type DepPath } from '@pnpm/types'

test('lockfileToDepGraph', () => {
expect(lockfileToDepGraph({
lockfileVersion: '9.0',
importers: {},
packages: {
'foo@1.0.0': {
['foo@1.0.0' as DepPath]: {
dependencies: {
bar: '1.0.0',
},
Expand All @@ -16,15 +17,15 @@ test('lockfileToDepGraph', () => {
integrity: '',
},
},
'bar@1.0.0': {
['bar@1.0.0' as DepPath]: {
dependencies: {
qar: '1.0.0',
},
resolution: {
integrity: '',
},
},
'qar@1.0.0': {
['qar@1.0.0' as DepPath]: {
resolution: {
integrity: '',
},
Expand All @@ -35,18 +36,18 @@ test('lockfileToDepGraph', () => {
children: {
qar: 'qar@1.0.0',
},
depPath: 'bar@1.0.0',
packageId: 'bar@1.0.0',
},
'foo@1.0.0': {
children: {
bar: 'bar@1.0.0',
qar: 'qar@1.0.0',
},
depPath: 'foo@1.0.0',
packageId: 'foo@1.0.0',
},
'qar@1.0.0': {
children: {},
depPath: 'qar@1.0.0',
packageId: 'qar@1.0.0',
},
})
})

0 comments on commit 479d4fd

Please sign in to comment.