Skip to content

Commit

Permalink
opt for cwd in test
Browse files Browse the repository at this point in the history
  • Loading branch information
nedsalk committed Jan 10, 2025
1 parent de67b4e commit b328090
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@
"vite-plugin-json5": "1.1.2",
"vite-plugin-node-polyfills": "0.22.0",
"vite-plugin-plain-text": "1.4.2",
"vitest": "2.0.5",
"fuels": "workspace:*"
"vitest": "2.0.5"
},
"pnpm": {
"overrides": {
Expand Down
8 changes: 8 additions & 0 deletions packages/fuels/test/features/dev.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { deferPromise } from '@fuel-ts/account';
import { spawn } from 'child_process';
import * as chokidar from 'chokidar';
import { join } from 'path';
import { cwd } from 'process';

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

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

const nodeLaunched = deferPromise<string>();
Expand Down

0 comments on commit b328090

Please sign in to comment.