From 91039836474d2fd93424d74a87c0187c00b4a287 Mon Sep 17 00:00:00 2001 From: Sergey Rubanov Date: Wed, 13 Sep 2023 15:33:26 +0200 Subject: [PATCH] chore(tests): update to Socket 0.4.0 --- templates/react-ts/test/index.ts | 2 -- templates/react-ts/test/test-context.ts | 14 -------------- templates/react/test/index.js | 2 -- templates/react/test/test-context.js | 14 -------------- templates/tonic/test/index.js | 2 -- templates/tonic/test/test-context.js | 14 -------------- templates/vanilla/test/index.js | 1 - templates/vanilla/test/test-context.js | 14 -------------- 8 files changed, 63 deletions(-) delete mode 100644 templates/react-ts/test/test-context.ts delete mode 100644 templates/react/test/test-context.js delete mode 100644 templates/tonic/test/test-context.js delete mode 100644 templates/vanilla/test/test-context.js diff --git a/templates/react-ts/test/index.ts b/templates/react-ts/test/index.ts index 9d59f72..3571e82 100644 --- a/templates/react-ts/test/index.ts +++ b/templates/react-ts/test/index.ts @@ -1,5 +1,3 @@ -import './test-context'; - import { test } from 'socket:test'; import os from 'socket:os'; diff --git a/templates/react-ts/test/test-context.ts b/templates/react-ts/test/test-context.ts deleted file mode 100644 index ff1b877..0000000 --- a/templates/react-ts/test/test-context.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { GLOBAL_TEST_RUNNER } from 'socket:test'; -import console from 'socket:console'; -import process from 'socket:process'; -import 'socket:runtime'; - -globalThis.addEventListener('error', onerror); -globalThis.addEventListener('unhandledrejection', onerror); - -function onerror(err: any) { - console.error(err.stack ?? err.reason ?? err.message ?? err); - process.exit(1); -} - -GLOBAL_TEST_RUNNER.onFinish(() => process.exit(0)); diff --git a/templates/react/test/index.js b/templates/react/test/index.js index 57f84ca..0fd4f1a 100644 --- a/templates/react/test/index.js +++ b/templates/react/test/index.js @@ -1,5 +1,3 @@ -import './test-context' - import { test } from 'socket:test' import os from 'socket:os' diff --git a/templates/react/test/test-context.js b/templates/react/test/test-context.js deleted file mode 100644 index 224b597..0000000 --- a/templates/react/test/test-context.js +++ /dev/null @@ -1,14 +0,0 @@ -import { GLOBAL_TEST_RUNNER } from 'socket:test' -import console from 'socket:console' -import process from 'socket:process' -import 'socket:runtime' - -globalThis.addEventListener('error', onerror) -globalThis.addEventListener('unhandledrejection', onerror) - -function onerror (err) { - console.error(err.stack ?? err.reason ?? err.message ?? err) - process.exit(1) -} - -GLOBAL_TEST_RUNNER.onFinish(() => process.exit(0)) diff --git a/templates/tonic/test/index.js b/templates/tonic/test/index.js index 57f84ca..0fd4f1a 100644 --- a/templates/tonic/test/index.js +++ b/templates/tonic/test/index.js @@ -1,5 +1,3 @@ -import './test-context' - import { test } from 'socket:test' import os from 'socket:os' diff --git a/templates/tonic/test/test-context.js b/templates/tonic/test/test-context.js deleted file mode 100644 index 224b597..0000000 --- a/templates/tonic/test/test-context.js +++ /dev/null @@ -1,14 +0,0 @@ -import { GLOBAL_TEST_RUNNER } from 'socket:test' -import console from 'socket:console' -import process from 'socket:process' -import 'socket:runtime' - -globalThis.addEventListener('error', onerror) -globalThis.addEventListener('unhandledrejection', onerror) - -function onerror (err) { - console.error(err.stack ?? err.reason ?? err.message ?? err) - process.exit(1) -} - -GLOBAL_TEST_RUNNER.onFinish(() => process.exit(0)) diff --git a/templates/vanilla/test/index.js b/templates/vanilla/test/index.js index 493a494..bac2980 100644 --- a/templates/vanilla/test/index.js +++ b/templates/vanilla/test/index.js @@ -1,4 +1,3 @@ -import './test-context' import { test } from 'socket:test' import os from 'socket:os' diff --git a/templates/vanilla/test/test-context.js b/templates/vanilla/test/test-context.js deleted file mode 100644 index 224b597..0000000 --- a/templates/vanilla/test/test-context.js +++ /dev/null @@ -1,14 +0,0 @@ -import { GLOBAL_TEST_RUNNER } from 'socket:test' -import console from 'socket:console' -import process from 'socket:process' -import 'socket:runtime' - -globalThis.addEventListener('error', onerror) -globalThis.addEventListener('unhandledrejection', onerror) - -function onerror (err) { - console.error(err.stack ?? err.reason ?? err.message ?? err) - process.exit(1) -} - -GLOBAL_TEST_RUNNER.onFinish(() => process.exit(0))