filesystem-sandbox
Advanced tools
Comparing version 1.6.4 to 1.7.0
@@ -13,4 +13,13 @@ /// <reference types="node" /> | ||
fullPathFor(relativePath: string): any; | ||
/** | ||
* Destroys all sandboxes created in this process up until now | ||
*/ | ||
static destroyAll(): Promise<void>; | ||
/** | ||
* Destroys the default base folder for sandboxes -- useful as a once-off | ||
* run before all tests to ensure that there are no lingering sandboxes | ||
* - cannot destroy sandboxes in custom paths | ||
*/ | ||
static destroyAny(): Promise<void>; | ||
static create(at: string): Promise<Sandbox>; | ||
} |
@@ -76,2 +76,5 @@ "use strict"; | ||
} | ||
/** | ||
* Destroys all sandboxes created in this process up until now | ||
*/ | ||
static async destroyAll() { | ||
@@ -83,2 +86,11 @@ const toDestroy = sandboxes.splice(0, sandboxes.length); | ||
} | ||
/** | ||
* Destroys the default base folder for sandboxes -- useful as a once-off | ||
* run before all tests to ensure that there are no lingering sandboxes | ||
* - cannot destroy sandboxes in custom paths | ||
*/ | ||
static async destroyAny() { | ||
const target = path.join(process.cwd(), exports.basePrefix); | ||
await rimraf(target); | ||
} | ||
static async create(at) { | ||
@@ -85,0 +97,0 @@ return new Sandbox(at); |
{ | ||
"name": "filesystem-sandbox", | ||
"version": "1.6.4", | ||
"version": "1.7.0", | ||
"description": "JavaScript module to provide filesystem sandboxes for testing", | ||
@@ -50,3 +50,3 @@ "main": "dist/index.js", | ||
"typescript": "^3.9.3", | ||
"zarro": "^1.48.7" | ||
"zarro": "^1.49.0" | ||
}, | ||
@@ -53,0 +53,0 @@ "dependencies": { |
7303
122