mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-04-01 03:05:57 +00:00
fixes and page test plan
This commit is contained in:
1196
rfcs/2026-02-05-xftp-web-e2e-tests.md
Normal file
1196
rfcs/2026-02-05-xftp-web-e2e-tests.md
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,12 @@
|
||||
import {defineConfig, type Plugin} from 'vite'
|
||||
import {readFileSync} from 'fs'
|
||||
import {createHash} from 'crypto'
|
||||
import {resolve} from 'path'
|
||||
import presets from './web/servers.json'
|
||||
import {PORT_FILE} from './test/globalSetup'
|
||||
|
||||
const __dirname = import.meta.dirname
|
||||
|
||||
function parseHost(addr: string): string {
|
||||
const m = addr.match(/@(.+)$/)
|
||||
if (!m) throw new Error('bad server address: ' + addr)
|
||||
@@ -46,7 +49,8 @@ export default defineConfig(({mode}) => {
|
||||
|
||||
return {
|
||||
root: 'web',
|
||||
build: {outDir: '../dist-web', target: 'esnext'},
|
||||
build: {outDir: resolve(__dirname, 'dist-web'), target: 'esnext'},
|
||||
preview: {host: true},
|
||||
define,
|
||||
worker: {format: 'es' as const},
|
||||
plugins: [cspPlugin(servers)],
|
||||
|
||||
@@ -182,6 +182,7 @@ async function handleCleanup(id: number) {
|
||||
// ── Message dispatch ────────────────────────────────────────────
|
||||
|
||||
self.onmessage = async (e: MessageEvent) => {
|
||||
await initPromise
|
||||
const msg = e.data
|
||||
try {
|
||||
switch (msg.type) {
|
||||
@@ -219,7 +220,7 @@ function digestEqual(a: Uint8Array, b: Uint8Array): boolean {
|
||||
|
||||
// ── Init ────────────────────────────────────────────────────────
|
||||
|
||||
;(async () => {
|
||||
const initPromise = (async () => {
|
||||
await sodium.ready
|
||||
await sweepStale()
|
||||
})()
|
||||
|
||||
Reference in New Issue
Block a user