test: add test for nodeCliInspect fuse (#43035)

This commit is contained in:
David Sanders 2024-07-25 02:00:02 -07:00 committed by GitHub
parent df524c6eca
commit f979d4c742
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,7 @@
import { expect } from 'chai';
import { startRemoteControlApp } from './lib/spec-helpers';
import { once } from 'node:events';
import { spawn } from 'node:child_process';
import { spawn, spawnSync } from 'node:child_process';
import { BrowserWindow } from 'electron';
import path = require('node:path');
@ -17,6 +17,13 @@ describe('fuses', () => {
expect(code1).to.equal(0);
});
it('disables --inspect flag when node_cli_inspect is 0', () => {
const { status, stderr } = spawnSync(process.execPath, ['--set-fuse-node_cli_inspect=0', '--inspect', '-v'], { encoding: 'utf-8' });
expect(stderr).to.not.include('Debugger listening on ws://');
// Should print the version and exit with 0
expect(status).to.equal(0);
});
it('disables fetching file:// URLs when grant_file_protocol_extra_privileges is 0', async () => {
const rc = await startRemoteControlApp(['--set-fuse-grant_file_protocol_extra_privileges=0']);
await expect(rc.remotely(async (fixture: string) => {