Skip to content

Commit b328090

Browse files
committed
opt for cwd in test
1 parent de67b4e commit b328090

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@
118118
"vite-plugin-json5": "1.1.2",
119119
"vite-plugin-node-polyfills": "0.22.0",
120120
"vite-plugin-plain-text": "1.4.2",
121-
"vitest": "2.0.5",
122-
"fuels": "workspace:*"
121+
"vitest": "2.0.5"
123122
},
124123
"pnpm": {
125124
"overrides": {

packages/fuels/test/features/dev.test.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { deferPromise } from '@fuel-ts/account';
22
import { spawn } from 'child_process';
33
import * as chokidar from 'chokidar';
4+
import { join } from 'path';
5+
import { cwd } from 'process';
46

57
import * as buildMod from '../../src/cli/commands/build/index';
68
import * as deployMod from '../../src/cli/commands/deploy/index';
@@ -92,6 +94,12 @@ describe('dev', () => {
9294

9395
const devProcess = spawn(`pnpm fuels dev --path ${paths.root}`, {
9496
shell: 'bash',
97+
/**
98+
* pnpm fuels dev fails because the test is run in the root directory
99+
* and there is no `fuels` dependency in `package.json` there,
100+
* so we have to give the spawn a cwd which has `fuels` as a dependency.
101+
*/
102+
cwd: join(cwd(), 'packages/fuel-gauge'),
95103
});
96104

97105
const nodeLaunched = deferPromise<string>();

0 commit comments

Comments
 (0)