@web/test-runner-commands
Advanced tools
Comparing version 0.5.2 to 0.5.3
# @web/test-runner-commands | ||
## 0.5.3 | ||
### Patch Changes | ||
- 3af6ff86: improve snapshot formatting | ||
## 0.5.2 | ||
@@ -4,0 +10,0 @@ |
@@ -76,7 +76,7 @@ "use strict"; | ||
const snapshotPath = getSnapshotPath(testFilePath); | ||
const startMarker = `// snapshot ${name}`; | ||
const nameStr = JSON.stringify(name); | ||
const startMarker = `snapshots[${nameStr}]`; | ||
const endMarker = `// end snapshot ${name}\n\n`; | ||
const nameStr = JSON.stringify(name); | ||
const replacement = updatedSnapshot | ||
? `${startMarker}\nsnapshots[${nameStr}] = \`${updatedSnapshot}\`;\n${endMarker}` | ||
? `${startMarker} = \n\`${updatedSnapshot}\`;\n${endMarker}` | ||
: ''; | ||
@@ -101,3 +101,3 @@ const content = await this.get(snapshotPath); | ||
this.snapshots.set(snapshotPath, updatedContent); | ||
if (updatedContent.includes('// snapshot')) { | ||
if (updatedContent.includes('// end snapshot')) { | ||
// update or create snapshot | ||
@@ -104,0 +104,0 @@ const fileDir = path_1.default.dirname(snapshotPath); |
{ | ||
"name": "@web/test-runner-commands", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
@@ -84,7 +84,7 @@ /* eslint-disable @typescript-eslint/no-empty-function */ | ||
const snapshotPath = getSnapshotPath(testFilePath); | ||
const startMarker = `// snapshot ${name}`; | ||
const nameStr = JSON.stringify(name); | ||
const startMarker = `snapshots[${nameStr}]`; | ||
const endMarker = `// end snapshot ${name}\n\n`; | ||
const nameStr = JSON.stringify(name); | ||
const replacement = updatedSnapshot | ||
? `${startMarker}\nsnapshots[${nameStr}] = \`${updatedSnapshot}\`;\n${endMarker}` | ||
? `${startMarker} = \n\`${updatedSnapshot}\`;\n${endMarker}` | ||
: ''; | ||
@@ -113,3 +113,3 @@ | ||
this.snapshots.set(snapshotPath, updatedContent); | ||
if (updatedContent.includes('// snapshot')) { | ||
if (updatedContent.includes('// end snapshot')) { | ||
// update or create snapshot | ||
@@ -116,0 +116,0 @@ const fileDir = path.dirname(snapshotPath); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83821