From 42727bb572bc33743953f7889ca8eacd746773f4 Mon Sep 17 00:00:00 2001 From: "guillem.cordoba" Date: Thu, 19 Dec 2024 15:02:51 +0100 Subject: [PATCH] Ignore unhandled --- tests/src/setup.ts | 18 ------- tests/vitest.config.ts | 42 ++++++++------- ui/custom-elements.json | 112 ++++++++++++++++++++-------------------- 3 files changed, 78 insertions(+), 94 deletions(-) diff --git a/tests/src/setup.ts b/tests/src/setup.ts index 60f49f5..21b1b00 100644 --- a/tests/src/setup.ts +++ b/tests/src/setup.ts @@ -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); @@ -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; }, @@ -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, diff --git a/tests/vitest.config.ts b/tests/vitest.config.ts index 7ecd61a..f37f82a 100644 --- a/tests/vitest.config.ts +++ b/tests/vitest.config.ts @@ -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'], + }, + }, + }, + }, }); diff --git a/ui/custom-elements.json b/ui/custom-elements.json index 7d2bcf0..c46e5cf 100644 --- a/ui/custom-elements.json +++ b/ui/custom-elements.json @@ -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", @@ -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",