Skip to content

Commit

Permalink
Ignore unhandled
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Dec 19, 2024
1 parent bf9f711 commit 42727bb
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 94 deletions.
18 changes: 0 additions & 18 deletions tests/src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import { MessengerClient } from '../../ui/src/messenger-client.js';
import { MessengerStore } from '../../ui/src/messenger-store.js';

async function setupStore(player: Player) {
patchCallZome(player.appWs as AppWebsocket);
await player.conductor
.adminWs()
.authorizeSigningCredentials(player.cells[0].cell_id);
Expand All @@ -57,7 +56,6 @@ async function setupStore(player: Player) {
installed_app_id: player.appId,
});
const appWs = await player.conductor.connectAppWs(issued.token, port);
patchCallZome(appWs);
store.client.client = appWs;
linkedDevicesStore.client.client = appWs;
},
Expand Down Expand Up @@ -86,22 +84,6 @@ export async function setup(scenario: Scenario, playerNum = 2) {
return playersAndStores;
}

function patchCallZome(appWs: AppWebsocket) {
const callZome = appWs.callZome;
appWs.callZome = async req => {
try {
const result = await callZome(req);
return result;
} catch (e) {
if (
!e.toString().includes('Socket is not open') &&
!e.toString().includes('ClientClosedWithPendingRequests')
) {
throw e;
}
}
};
}
export async function linkDevices(
store1: LinkedDevicesStore,
store2: LinkedDevicesStore,
Expand Down
42 changes: 22 additions & 20 deletions tests/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
import { defineConfig } from "vitest/config";
import { defineConfig } from 'vitest/config';

//@ts-ignore
import pkg from "./package.json";
import pkg from './package.json';

export default defineConfig({
test: {
poolOptions: {
threads: {
singleThread: true,
},
},
testTimeout: 60 * 1000 * 3, // 3 mins
deps: {
optimizer: {
ssr: {
enabled: true,
//@ts-ignore
include: Object.keys(pkg.dependencies),
exclude: ["@holochain/client"],
},
},
},
},
test: {
dangerouslyIgnoreUnhandledErrors: true,
poolOptions: {
threads: {
singleThread: true,
},
},
testTimeout: 60 * 1000 * 3, // 3 mins
deps: {
optimizer: {
ssr: {
enabled: true,
//@ts-ignore
include: Object.keys(pkg.dependencies),
exclude: ['@holochain/client'],
},
},
},
},
});
112 changes: 56 additions & 56 deletions ui/custom-elements.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,62 @@
"schemaVersion": "1.0.0",
"readme": "",
"modules": [
{
"kind": "javascript-module",
"path": "locales/locales.js",
"declarations": [
{
"kind": "variable",
"name": "sourceLocale",
"default": "`en`",
"description": "The locale code that templates in this source code are written in."
},
{
"kind": "variable",
"name": "targetLocales",
"type": {
"text": "array"
},
"default": "[ , ]",
"description": "The other locale codes that this application is localized into. Sorted\nlexicographically."
},
{
"kind": "variable",
"name": "allLocales",
"type": {
"text": "array"
},
"default": "[ `en`, ]",
"description": "All valid project locale codes. Sorted lexicographically."
}
],
"exports": [
{
"kind": "js",
"name": "sourceLocale",
"declaration": {
"name": "sourceLocale",
"module": "locales/locales.js"
}
},
{
"kind": "js",
"name": "targetLocales",
"declaration": {
"name": "targetLocales",
"module": "locales/locales.js"
}
},
{
"kind": "js",
"name": "allLocales",
"declaration": {
"name": "allLocales",
"module": "locales/locales.js"
}
}
]
},
{
"kind": "javascript-module",
"path": "src/context.ts",
Expand Down Expand Up @@ -1126,62 +1182,6 @@
}
]
},
{
"kind": "javascript-module",
"path": "locales/locales.js",
"declarations": [
{
"kind": "variable",
"name": "sourceLocale",
"default": "`en`",
"description": "The locale code that templates in this source code are written in."
},
{
"kind": "variable",
"name": "targetLocales",
"type": {
"text": "array"
},
"default": "[ , ]",
"description": "The other locale codes that this application is localized into. Sorted\nlexicographically."
},
{
"kind": "variable",
"name": "allLocales",
"type": {
"text": "array"
},
"default": "[ `en`, ]",
"description": "All valid project locale codes. Sorted lexicographically."
}
],
"exports": [
{
"kind": "js",
"name": "sourceLocale",
"declaration": {
"name": "sourceLocale",
"module": "locales/locales.js"
}
},
{
"kind": "js",
"name": "targetLocales",
"declaration": {
"name": "targetLocales",
"module": "locales/locales.js"
}
},
{
"kind": "js",
"name": "allLocales",
"declaration": {
"name": "allLocales",
"module": "locales/locales.js"
}
}
]
},
{
"kind": "javascript-module",
"path": "src/elements/all-chats.ts",
Expand Down

0 comments on commit 42727bb

Please sign in to comment.