Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix integration tests #8160

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 20 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"better-sqlite3": "git+https://github.com/tutao/better-sqlite3-sqlcipher#53d4abb647a52eb0d3dc0d46acb192bc5e2c0f40",
"cborg": "4.2.2",
"dompurify": "3.2.3",
"electron": "33.2.0",
"electron": "33.3.0",
"electron-updater": "6.3.4",
"jszip": "3.10.1",
"linkify-html": "4.1.3",
Expand Down Expand Up @@ -90,7 +90,7 @@
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-unicorn": "55.0.0",
"express": "4.21.0",
"express": "4.21.2",
"fs-extra": "11.2.0",
"full-icu": "1.5.0",
"js-yaml": "4.1.0",
Expand Down
14 changes: 12 additions & 2 deletions packages/otest/lib/otest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,12 @@ class OTest {
}

for (const before of spec.before) {
await before()
try {
await before()
} catch (e) {
console.error("Spec before() failed!", newPathSerialized, e)
throw e
}
}

const specMatches = filter === "" || spec.name.includes(filter)
Expand Down Expand Up @@ -179,7 +184,12 @@ class OTest {
}

for (const after of spec.after) {
await after()
try {
await after()
} catch (e) {
console.error("Spec after() failed!", newPathSerialized, e)
throw e
}
}

return result
Expand Down
2 changes: 1 addition & 1 deletion src/RootView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class RootView implements ClassComponent {
height: "100%",
},
},
[m(overlay), m(modal), vnode.children],
[m(overlay), m(modal), m(".main-view", { inert: modal.visible }, vnode.children)],
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/api/common/threading/Transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface Transport<OutgoingCommandType, IncomingCommandType> {
/**
* Set the handler for messages coming from the other end of the transport
*/
setMessageHandler(handler: (message: Message<IncomingCommandType>) => unknown): unknown
setMessageHandler(handler: (message: Message<IncomingCommandType>) => unknown): void
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/common/api/main/EntropyCollector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class EntropyCollector {
}

private addPerformanceTimingValues() {
if (!this.window.performance) return
if (!this.window.performance?.getEntries) return
const entries = this.window.performance.getEntries()
let added: number[] = []
for (const entry of entries.map((e) => e.toJSON())) {
Expand Down
5 changes: 4 additions & 1 deletion src/common/api/main/WorkerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,17 @@ export class WorkerClient {
const WorkerImpl = globalThis.testWorker
const workerImpl = new WorkerImpl(this, true)
await workerImpl.init(client.browserData())
workerImpl._queue._transport = {
workerImpl._dispatcher.transport = {
postMessage: (msg: any) => this._dispatcher.handleMessage(msg),
}
this._dispatcher = new MessageDispatcher(
{
postMessage: function (msg: any) {
workerImpl._queue.handleMessage(msg)
},
setMessageHandler(handler: (message: any) => unknown): void {
return
},
} as Transport<WorkerRequestType, MainRequestType>,
this.queueCommands(locator),
"main-worker",
Expand Down
Loading
Loading