Skip to content

Commit fc59de5

Browse files
committed
fix: normalize service-open test paths for windows
The expectations built paths with node:path (backslashes on Windows) while the service resolves through pathe (forward slashes). Also declare the pathe runtime dependency the service was getting via hoisting.
1 parent 8e0b4c1 commit fc59de5

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎pnpm-lock.yaml‎

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎services/open/package.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
"peerDependencies": {
3838
"devframe": "workspace:*"
3939
},
40+
"dependencies": {
41+
"pathe": "catalog:deps"
42+
},
4043
"devDependencies": {
4144
"@types/node": "catalog:types",
4245
"devframe": "workspace:*",

‎services/open/test/service.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import type { DevframeHost } from 'devframe/types'
22
import { mkdtempSync, rmSync } from 'node:fs'
33
import { tmpdir } from 'node:os'
4-
import { join } from 'node:path'
54
import { createHostContext } from 'devframe/node'
5+
// `pathe` (not `node:path`) so the expected paths use the same normalized
6+
// forward-slash form the service resolves to on every OS.
7+
import { join } from 'pathe'
68
import { afterEach, describe, expect, it, vi } from 'vitest'
79
import { createOpenService } from '../src/index'
810

0 commit comments

Comments
 (0)