Socket
Socket
Sign inDemoInstall

@vitest/snapshot

Package Overview
Dependencies
Maintainers
4
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitest/snapshot - npm Package Compare versions

Comparing version 2.0.0-beta.2 to 2.0.0-beta.3

20

dist/index.js

@@ -313,3 +313,3 @@ import { plugins, format } from 'pretty-format';

function escapeBacktickString(str) {
return str.replace(/`|\\|\${/g, "\\$&");
return str.replace(/`|\\|\$\{/g, "\\$&");
}

@@ -342,3 +342,3 @@ function printBacktickString(str) {

var _a, _b;
const matchObject = /^( +)}\s+$/m.exec(expected || "");
const matchObject = /^( +)\}\s+$/m.exec(expected || "");
const objectIndent = (_a = matchObject == null ? void 0 : matchObject[1]) == null ? void 0 : _a.length;

@@ -353,3 +353,3 @@ if (objectIndent)

if (startIndent) {
expectedTrimmed = expectedTrimmed == null ? void 0 : expectedTrimmed.replace(new RegExp(`^${" ".repeat(startIndent)}`, "gm"), "").replace(/ +}$/, "}");
expectedTrimmed = expectedTrimmed == null ? void 0 : expectedTrimmed.replace(new RegExp(`^${" ".repeat(startIndent)}`, "gm"), "").replace(/ +\}$/, "}");
}

@@ -951,4 +951,4 @@ return expectedTrimmed;

const CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
const SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/;
const CHROME_IE_STACK_REGEXP = /^\s*at .*(?:\S:\d+|\(native\))/m;
const SAFARI_NATIVE_CODE_REGEXP = /^(?:eval@)?(?:\[native code\])?$/;
const stackIgnorePatterns = [

@@ -993,3 +993,3 @@ "node:internal",

return null;
const functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/;
const functionNameRegex = /((.*".+"[^@]*)?[^@]*)(@)/;
const matches = line.match(functionNameRegex);

@@ -1087,3 +1087,3 @@ const functionName = matches && matches[1] ? matches[1] : void 0;

}
const startObjectRegex = /(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\s*\(\s*(?:\/\*[\S\s]*\*\/\s*|\/\/.*\s+)*\s*({)/m;
const startObjectRegex = /(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\s*\(\s*(?:\/\*[\s\S]*\*\/\s*|\/\/.*(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))*\{/;
function replaceObjectSnap(code, s, index, newSnap) {

@@ -1130,8 +1130,8 @@ let _code = code.slice(index);

if (isOneline)
return `${quote}${lines.join("\n").replace(/`/g, "\\`").replace(/\${/g, "\\${")}${quote}`;
return `${quote}${lines.join("\n").replace(/`/g, "\\`").replace(/\$\{/g, "\\${")}${quote}`;
return `${quote}
${lines.map((i) => i ? indentNext + i : "").join("\n").replace(/`/g, "\\`").replace(/\${/g, "\\${")}
${lines.map((i) => i ? indentNext + i : "").join("\n").replace(/`/g, "\\`").replace(/\$\{/g, "\\${")}
${indent}${quote}`;
}
const startRegex = /(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\s*\(\s*(?:\/\*[\S\s]*\*\/\s*|\/\/.*\s+)*\s*[\w_$]*(['"`\)])/m;
const startRegex = /(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\s*\(\s*(?:\/\*[\s\S]*\*\/\s*|\/\/.*(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))*[\w$]*(['"`)])/;
function replaceInlineSnap(code, s, index, newSnap) {

@@ -1138,0 +1138,0 @@ const codeStartingAtIndex = code.slice(index);

{
"name": "@vitest/snapshot",
"type": "module",
"version": "2.0.0-beta.2",
"version": "2.0.0-beta.3",
"description": "Vitest snapshot manager",

@@ -48,3 +48,3 @@ "license": "MIT",

"natural-compare": "^1.4.0",
"@vitest/utils": "2.0.0-beta.2"
"@vitest/utils": "2.0.0-beta.3"
},

@@ -51,0 +51,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc