Skip to content

Commit 66296dc

Browse files
committed
test(tailwindcss-patch): pack from workspace package dirs
1 parent 51188b8 commit 66296dc

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

packages/tailwindcss-patch/test/packaged-runtime-dependency.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { execFileSync } from 'node:child_process'
22
import fsSync, { promises as fs } from 'node:fs'
33
import { createRequire } from 'node:module'
4-
import os from 'node:os'
54
import path from 'node:path'
65
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
76

@@ -39,7 +38,7 @@ function run(command: string, args: string[], cwd: string, timeout = 180_000) {
3938
async function packPackage(packageDirectory: string) {
4039
const packDir = path.join(tempDir, 'pack')
4140
await fs.mkdir(packDir, { recursive: true })
42-
const output = run('pnpm', ['--dir', packageDirectory, 'pack', '--json', '--pack-destination', packDir], repoRoot)
41+
const output = run('pnpm', ['pack', '--json', '--pack-destination', path.relative(packageDirectory, packDir)], packageDirectory)
4342
const result = JSON.parse(output) as { filename: string }
4443
return result.filename
4544
}
@@ -104,7 +103,7 @@ function runProjectScript(projectDir: string, source: string) {
104103

105104
describe('packed tailwindcss-patch runtime dependencies', () => {
106105
beforeEach(async () => {
107-
tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'tw-patch-packaged-'))
106+
tempDir = await fs.mkdtemp(path.join(repoRoot, '.tmp-tw-patch-packaged-'))
108107
})
109108

110109
afterEach(async () => {

0 commit comments

Comments
 (0)