MCPcopy
hub / github.com/sveltejs/svelte / capture_warnings

Function capture_warnings

packages/svelte/src/internal/shared/clone.test.ts:5–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import { proxy } from '../client/proxy';
4
5function capture_warnings() {
6 const warnings: string[] = [];
7
8 // eslint-disable-next-line no-console
9 const warn = console.warn;
10
11 // eslint-disable-next-line no-console
12 console.warn = (message) => warnings.push(message);
13
14 return () => {
15 // eslint-disable-next-line no-console
16 console.warn = warn;
17 return warnings;
18 };
19}
20
21test('primitive', () => {
22 assert.equal(42, snapshot(42));

Callers 1

clone.test.tsFile · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected