test: add HTTP2-disabled diagnostic bootstrap
This commit is contained in:
16
tests/unit/http2-diagnostic-bootstrap.test.ts
Normal file
16
tests/unit/http2-diagnostic-bootstrap.test.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { resolve } from 'node:path';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
describe('HTTP/1.1 diagnostic bootstrap', () => {
|
||||
it('disables HTTP/2 before Electron startup and network initialization', () => {
|
||||
const source = readFileSync(resolve(process.cwd(), 'electron/main/index.ts'), 'utf8');
|
||||
const disableHttp2 = source.indexOf("app.commandLine.appendSwitch('disable-http2')");
|
||||
const singleInstanceLock = source.indexOf('app.requestSingleInstanceLock()');
|
||||
const ready = source.indexOf('app.whenReady()');
|
||||
|
||||
expect(disableHttp2).toBeGreaterThan(-1);
|
||||
expect(disableHttp2).toBeLessThan(singleInstanceLock);
|
||||
expect(disableHttp2).toBeLessThan(ready);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user