Comparing version 4.0.0 to 4.0.1
@@ -227,4 +227,4 @@ import process from 'node:process'; | ||
saveSnapshotState() { | ||
return {touchedFiles: this.snapshots.save()}; | ||
async saveSnapshotState() { | ||
return {touchedFiles: await this.snapshots.save()}; | ||
} | ||
@@ -231,0 +231,0 @@ |
@@ -185,4 +185,4 @@ import {Buffer} from 'node:buffer'; | ||
function encodeSnapshots(snapshotData) { | ||
const encoded = cbor.encodeOne(snapshotData, { | ||
async function encodeSnapshots(snapshotData) { | ||
const encoded = await cbor.encodeAsync(snapshotData, { | ||
omitUndefinedProperties: true, | ||
@@ -355,3 +355,3 @@ canonical: true, | ||
save() { | ||
async save() { | ||
const {dir, relFile, snapFile, snapPath, reportPath} = this; | ||
@@ -376,11 +376,13 @@ | ||
const buffer = encodeSnapshots(snapshots); | ||
const buffer = await encodeSnapshots(snapshots); | ||
const reportBuffer = generateReport(relFile, snapFile, snapshots); | ||
fs.mkdirSync(dir, {recursive: true}); | ||
await fs.promises.mkdir(dir, {recursive: true}); | ||
const temporaryFiles = []; | ||
const tmpfileCreated = file => temporaryFiles.push(file); | ||
writeFileAtomic.sync(snapPath, buffer, {tmpfileCreated}); | ||
writeFileAtomic.sync(reportPath, reportBuffer, {tmpfileCreated}); | ||
await Promise.all([ | ||
writeFileAtomic(snapPath, buffer, {tmpfileCreated}), | ||
writeFileAtomic(reportPath, reportBuffer, {tmpfileCreated}), | ||
]); | ||
return { | ||
@@ -387,0 +389,0 @@ changedFiles: [snapPath, reportPath], |
@@ -84,3 +84,3 @@ import {createRequire} from 'node:module'; | ||
try { | ||
const {touchedFiles} = runner.saveSnapshotState(); | ||
const {touchedFiles} = await runner.saveSnapshotState(); | ||
if (touchedFiles) { | ||
@@ -87,0 +87,0 @@ channel.send({type: 'touched-files', files: touchedFiles}); |
{ | ||
"name": "ava", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Node.js test runner that lets you develop with confidence.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
258664
7473