|
1 | 1 | import { execFileSync } from 'node:child_process' |
2 | 2 | import fsSync, { promises as fs } from 'node:fs' |
3 | 3 | import { createRequire } from 'node:module' |
4 | | -import os from 'node:os' |
5 | 4 | import path from 'node:path' |
6 | 5 | import { afterEach, beforeEach, describe, expect, it } from 'vitest' |
7 | 6 |
|
@@ -39,7 +38,7 @@ function run(command: string, args: string[], cwd: string, timeout = 180_000) { |
39 | 38 | async function packPackage(packageDirectory: string) { |
40 | 39 | const packDir = path.join(tempDir, 'pack') |
41 | 40 | 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) |
43 | 42 | const result = JSON.parse(output) as { filename: string } |
44 | 43 | return result.filename |
45 | 44 | } |
@@ -104,7 +103,7 @@ function runProjectScript(projectDir: string, source: string) { |
104 | 103 |
|
105 | 104 | describe('packed tailwindcss-patch runtime dependencies', () => { |
106 | 105 | 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-')) |
108 | 107 | }) |
109 | 108 |
|
110 | 109 | afterEach(async () => { |
|
0 commit comments