@vitest/snapshot 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { Plugin, OptionsReceived } from 'pretty-format';
1
+ import { Plugin, OptionsReceived } from '@vitest/pretty-format';
2
2
  import { S as SnapshotEnvironment } from './environment-Ddx0EDtY.js';
3
3
 
4
4
  interface RawSnapshotInfo {
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { S as SnapshotStateOptions, a as SnapshotMatchOptions, b as SnapshotResult, R as RawSnapshotInfo } from './index-reKGmLsM.js';
2
- export { c as SnapshotData, e as SnapshotSerializer, f as SnapshotSummary, d as SnapshotUpdateState, U as UncheckedSnapshot } from './index-reKGmLsM.js';
1
+ import { S as SnapshotStateOptions, a as SnapshotMatchOptions, b as SnapshotResult, R as RawSnapshotInfo } from './index-Y6kQUiCB.js';
2
+ export { c as SnapshotData, e as SnapshotSerializer, f as SnapshotSummary, d as SnapshotUpdateState, U as UncheckedSnapshot } from './index-Y6kQUiCB.js';
3
3
  import { S as SnapshotEnvironment } from './environment-Ddx0EDtY.js';
4
- import { Plugin, Plugins } from 'pretty-format';
4
+ import { Plugin, Plugins } from '@vitest/pretty-format';
5
5
 
6
6
  interface ParsedStack {
7
7
  method: string;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { plugins, format } from 'pretty-format';
1
+ import { plugins, format } from '@vitest/pretty-format';
2
2
  import { resolve as resolve$2 } from 'pathe';
3
3
 
4
4
  function getDefaultExportFromCjs (x) {
@@ -232,6 +232,87 @@ var reservedWords = {
232
232
  ]
233
233
  }; new Set(reservedWords.keyword); new Set(reservedWords.strict);
234
234
 
235
+ // src/index.ts
236
+ var f = {
237
+ reset: [0, 0],
238
+ bold: [1, 22, "\x1B[22m\x1B[1m"],
239
+ dim: [2, 22, "\x1B[22m\x1B[2m"],
240
+ italic: [3, 23],
241
+ underline: [4, 24],
242
+ inverse: [7, 27],
243
+ hidden: [8, 28],
244
+ strikethrough: [9, 29],
245
+ black: [30, 39],
246
+ red: [31, 39],
247
+ green: [32, 39],
248
+ yellow: [33, 39],
249
+ blue: [34, 39],
250
+ magenta: [35, 39],
251
+ cyan: [36, 39],
252
+ white: [37, 39],
253
+ gray: [90, 39],
254
+ bgBlack: [40, 49],
255
+ bgRed: [41, 49],
256
+ bgGreen: [42, 49],
257
+ bgYellow: [43, 49],
258
+ bgBlue: [44, 49],
259
+ bgMagenta: [45, 49],
260
+ bgCyan: [46, 49],
261
+ bgWhite: [47, 49],
262
+ blackBright: [90, 39],
263
+ redBright: [91, 39],
264
+ greenBright: [92, 39],
265
+ yellowBright: [93, 39],
266
+ blueBright: [94, 39],
267
+ magentaBright: [95, 39],
268
+ cyanBright: [96, 39],
269
+ whiteBright: [97, 39],
270
+ bgBlackBright: [100, 49],
271
+ bgRedBright: [101, 49],
272
+ bgGreenBright: [102, 49],
273
+ bgYellowBright: [103, 49],
274
+ bgBlueBright: [104, 49],
275
+ bgMagentaBright: [105, 49],
276
+ bgCyanBright: [106, 49],
277
+ bgWhiteBright: [107, 49]
278
+ }, h = Object.entries(f);
279
+ function a(n) {
280
+ return String(n);
281
+ }
282
+ a.open = "";
283
+ a.close = "";
284
+ function C(n = !1) {
285
+ let e = typeof process != "undefined" ? process : void 0, i = (e == null ? void 0 : e.env) || {}, g = (e == null ? void 0 : e.argv) || [];
286
+ return !("NO_COLOR" in i || g.includes("--no-color")) && ("FORCE_COLOR" in i || g.includes("--color") || (e == null ? void 0 : e.platform) === "win32" || n && i.TERM !== "dumb" || "CI" in i) || typeof window != "undefined" && !!window.chrome;
287
+ }
288
+ function p(n = !1) {
289
+ let e = C(n), i = (r, t, c, o) => {
290
+ let l = "", s = 0;
291
+ do
292
+ l += r.substring(s, o) + c, s = o + t.length, o = r.indexOf(t, s);
293
+ while (~o);
294
+ return l + r.substring(s);
295
+ }, g = (r, t, c = r) => {
296
+ let o = (l) => {
297
+ let s = String(l), b = s.indexOf(t, r.length);
298
+ return ~b ? r + i(s, t, c, b) + t : r + s + t;
299
+ };
300
+ return o.open = r, o.close = t, o;
301
+ }, u = {
302
+ isColorSupported: e
303
+ }, d = (r) => `\x1B[${r}m`;
304
+ for (let [r, t] of h)
305
+ u[r] = e ? g(
306
+ d(t[0]),
307
+ d(t[1]),
308
+ t[2]
309
+ ) : a;
310
+ return u;
311
+ }
312
+
313
+ // src/browser.ts
314
+ p(!1);
315
+
235
316
  const serialize$1 = (val, config, indentation, depth, refs, printer) => {
236
317
  const name = val.getMockName();
237
318
  const nameString = name === "vi.fn()" ? "" : ` ${name}`;
package/dist/manager.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as SnapshotStateOptions, f as SnapshotSummary, b as SnapshotResult } from './index-reKGmLsM.js';
2
- import 'pretty-format';
1
+ import { S as SnapshotStateOptions, f as SnapshotSummary, b as SnapshotResult } from './index-Y6kQUiCB.js';
2
+ import '@vitest/pretty-format';
3
3
  import './environment-Ddx0EDtY.js';
4
4
 
5
5
  declare class SnapshotManager {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/snapshot",
3
3
  "type": "module",
4
- "version": "2.0.0",
4
+ "version": "2.0.2",
5
5
  "description": "Vitest snapshot manager",
6
6
  "license": "MIT",
7
7
  "funding": "https://opencollective.com/vitest",
@@ -40,12 +40,12 @@
40
40
  "dependencies": {
41
41
  "magic-string": "^0.30.10",
42
42
  "pathe": "^1.1.2",
43
- "pretty-format": "^29.7.0"
43
+ "@vitest/pretty-format": "2.0.2"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/natural-compare": "^1.4.3",
47
47
  "natural-compare": "^1.4.0",
48
- "@vitest/utils": "2.0.0"
48
+ "@vitest/utils": "2.0.2"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "rimraf dist && rollup -c",