Files
makelore/tests/unit/http2-diagnostic-bootstrap.test.ts

17 lines
736 B
TypeScript

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);
});
});