Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 10 additions & 33 deletions src/__tests__/cli-argv.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,47 +272,24 @@ describe('CLI argv parsing', () => {
);

testWithBuiltCli(
'warns on stderr that browser is deprecated, for the command and its subcommands',
() => {
const offline = [
'--api-key',
'fc-test',
'--api-url',
'http://127.0.0.1:9',
];
for (const [args, status] of [
[['browser', ...offline], 0],
[['browser', 'list', ...offline], 1],
] as const) {
const result = spawnSync(process.execPath, [cliPath, ...args], {
encoding: 'utf8',
env: { ...process.env, FIRECRAWL_NO_UPDATE_CHECK: '1' },
});
expect(result.status).toBe(status);
expect(result.stderr).toContain(
'`firecrawl browser` is deprecated and will be removed'
);
expect(result.stderr).toContain('firecrawl interact');
expect(result.stdout).not.toContain('deprecated and will be removed');
}
}
);

testWithBuiltCli(
'shows the browser deprecation warning in browser help and subcommand help',
'points every removed browser invocation to scrape and interact',
() => {
for (const args of [
['browser', 'open https://example.com'],
['browser', 'launch-session', '--ttl', '600'],
['browser', 'execute', '--python', 'print(1)'],
['browser', 'close', '--session', 'abc'],
['browser', '--help'],
['browser', 'list', '--help'],
['help', 'browser'],
]) {
const result = spawnSync(process.execPath, [cliPath, ...args], {
encoding: 'utf8',
env: { ...process.env, FIRECRAWL_NO_UPDATE_CHECK: '1' },
});
expect(result.status).toBe(0);
expect(result.stdout).toContain(
'`firecrawl browser` is deprecated and will be removed'
);
expect(result.status).toBe(1);
expect(result.stderr).toContain('`firecrawl browser` was removed');
expect(result.stderr).toContain('firecrawl interact');
expect(result.stdout).toBe('');
}
}
);
Expand Down
325 changes: 0 additions & 325 deletions src/__tests__/commands/browser.test.ts

This file was deleted.

Loading
Loading