enso/app/gui/integration-test/project-view/setup.ts
Adam Obuchowicz 736134e491
Add traces to integration tests + suppress one flaky assertion. (#11595)
Fixes #11604

Most issues were caused by a problem with Project List flooding the network with its requests - this was fixed on develop.
But one assertion was flaky - it assumed we will see the "real" run result on `write` node, but sometimes it is immediately overwritten by dry run.

But the most important part of this PR is adding traces to Electron packages - it's should be much easier now to debug E2E test failures.

Also renamed the previously misnamed "E2E tests" to "[GUI] integration tests".
2024-11-27 14:09:59 +00:00

44 lines
1.1 KiB
TypeScript

import { Server } from '@open-rpc/server-js'
import * as random from 'lib0/random'
import pmSpec from './pm-openrpc.json' with { type: 'json' }
import {
methods as pmMethods,
projects,
type ProjectId,
type ProjectName,
type UTCDateTime,
} from './projectManager'
/**
* Setup for all Project View's Integration tests.
*
* It runs mocked project manager server.
*/
export default function setup() {
const pm = new Server({
transportConfigs: [
{
type: 'WebSocketTransport',
options: {
id: 'websocket',
udp: true,
ipv6: true,
port: 30536,
middleware: [],
},
},
],
openrpcDocument: pmSpec as typeof pmSpec & { openrpc: never },
methodMapping: pmMethods,
})
pm.start()
projects.set('mock project id 0001', {
id: random.uuidv4() as ProjectId,
created: new Date().toISOString() as UTCDateTime,
lastOpened: new Date().toISOString() as UTCDateTime,
engineVersion: '',
name: 'Mock Project Name' as ProjectName,
namespace: 'local',
})
}