Skip to content

Commit b56f6fe

Browse files
committed
fix: pass --no-sandbox to Puppeteer in GitHub Actions
1 parent 12c1d48 commit b56f6fe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/cli.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { execSync } from 'child_process';
55
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
66

77
const CLI_PATH = path.resolve('./build/src/cli.js');
8+
const DISABLE_SANDBOX = process.env.GITHUB_ACTIONS ? `--puppeteerOptions '{"args":["--no-sandbox"]}'` : '';
89
const TEST_OUTPUT_DIR = path.join(os.tmpdir(), 'pdown-test-output');
910

1011
describe('CLI', () => {
@@ -60,14 +61,14 @@ describe('CLI', () => {
6061
}
6162
}
6263
];
63-
const output = execSync(`node ${CLI_PATH} ls KGER0RS624#LzmiMIuikOuj --recursive --json`, { encoding: 'utf8' });
64+
const output = execSync(`node ${CLI_PATH} ls KGER0RS624#LzmiMIuikOuj --recursive --json ${DISABLE_SANDBOX}`, { encoding: 'utf8' });
6465
expect(JSON.parse(JSON.parse(output).message)).toEqual(expected);
6566
});
6667
});
6768

6869
describe('dl', () => {
6970
it('should be able to download password protected shares', () => {
70-
execSync(`node ${CLI_PATH} Y5J2AT9QJ0#HjVxIlCjfd99 --password love --output ${TEST_OUTPUT_DIR}`, { encoding: 'utf8' });
71+
execSync(`node ${CLI_PATH} Y5J2AT9QJ0#HjVxIlCjfd99 --password love --output ${TEST_OUTPUT_DIR} ${DISABLE_SANDBOX}`, { encoding: 'utf8' });
7172

7273
const files = fs.readdirSync(TEST_OUTPUT_DIR);
7374
expect(files.length).toBeGreaterThan(0);

0 commit comments

Comments
 (0)