diff --git a/package.json b/package.json index 9aa42035d..f70202272 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "scripts": { "bench": "tsc && node --expose-gc dist/benchmark", "format": "prettier --write .", - "test": "tsc && c8 --reporter lcov node --trace-warnings --test dist/test", + "test": "tsc && c8 --reporter lcov --reporter text node --trace-warnings --test dist/test", "test:only": "tsc; node --trace-warnings --test-only --test dist/test" }, "dependencies": { diff --git a/register.js b/register.js index c365f868a..ba8a10f71 100644 --- a/register.js +++ b/register.js @@ -4,6 +4,7 @@ let root; try { root = Function('return this')(); + /* c8 ignore next 3 */ } catch (_) { root = window; } diff --git a/suspense.js b/suspense.js index 6a63a32a1..fdc41e53c 100644 --- a/suspense.js +++ b/suspense.js @@ -57,7 +57,7 @@ function Suspense(props) { const fallback = contentsToString([props.fallback]); if (!props.children) { - return fallback; + return ''; } const children = contentsToString([props.children]); diff --git a/test/error-boundary.test.tsx b/test/error-boundary.test.tsx index 2086e0d11..8a04a8228 100644 --- a/test/error-boundary.test.tsx +++ b/test/error-boundary.test.tsx @@ -2,7 +2,7 @@ import assert from 'node:assert'; import { describe, it } from 'node:test'; import { setTimeout } from 'timers/promises'; import Html from '../'; -import { ErrorBoundary } from '../error-boundary'; +import { ErrorBoundary, isTimeoutError } from '../error-boundary'; describe('Error Boundary', () => { it('should render error boundary', async () => { @@ -63,4 +63,34 @@ describe('Error Boundary', () => { assert.equal(html,