We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 76b3d45 commit 1fa694dCopy full SHA for 1fa694d
packages/@lwc/integration-not-karma/helpers/console.js
@@ -0,0 +1,23 @@
1
+import { spyOn } from '@vitest/spy';
2
+
3
+/**
4
+ * A much simplified version of the spies originally used for Karma.
5
+ * Should probably be eventually replaced with individual spies.
6
+ */
7
+export function spyConsole() {
8
+ const log = spyOn(console, 'log');
9
+ const warn = spyOn(console, 'warn');
10
+ const error = spyOn(console, 'error');
11
+ return {
12
+ calls: {
13
+ log: log.mock.calls,
14
+ warn: warn.mock.calls,
15
+ error: error.mock.calls,
16
+ },
17
+ reset() {
18
+ log.mockRestore();
19
+ warn.mockRestore();
20
+ error.mockRestore();
21
22
+ };
23
+}
0 commit comments