Skip to content

Commit efd2270

Browse files
committed
chore: do it proper
1 parent f6cd17e commit efd2270

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/commands/run.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,18 @@ describe('apify run', () => {
270270
it('run with purge works without storage folder', async () => {
271271
await rimrafPromised(getLocalStorageDir());
272272

273-
writeFileSync(joinPath('src/main.js'), 'console.log("hello world");', { flag: 'w' });
273+
writeFileSync(
274+
joinPath('src/main.js'),
275+
`
276+
import { writeFileSync } from 'node:fs';
277+
writeFileSync('${joinPath('result.txt')}', 'hello world');
278+
`,
279+
{ flag: 'w' },
280+
);
274281

275282
await runCommand(RunCommand, { flags_purge: true });
276283

277-
expect(lastErrorMessage()).toMatch(/npm(?:\.cmd) run start/);
284+
expect(existsSync(joinPath('result.txt'))).toBeTruthy();
278285
});
279286

280287
describe('input tests', () => {

0 commit comments

Comments
 (0)