From f979d4c74203fb495c187f747b02f464774893da Mon Sep 17 00:00:00 2001 From: David Sanders Date: Thu, 25 Jul 2024 02:00:02 -0700 Subject: [PATCH] test: add test for nodeCliInspect fuse (#43035) --- spec/fuses-spec.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spec/fuses-spec.ts b/spec/fuses-spec.ts index fe3955732e..5fb0013c0e 100644 --- a/spec/fuses-spec.ts +++ b/spec/fuses-spec.ts @@ -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) => {