test-fixture
Advanced tools
Comparing version 2.1.1 to 2.2.0
15
index.js
@@ -44,3 +44,4 @@ const path = require('path') | ||
to, | ||
install = false | ||
install = false, | ||
clean = false | ||
} = isObject(options) | ||
@@ -52,2 +53,14 @@ ? options | ||
if (to && clean) { | ||
try { | ||
await fse.remove(to) | ||
} catch (err) { | ||
// istanbul ignore next | ||
if (err.code !== 'ENOENT') { | ||
// istanbul ignore next | ||
throw err | ||
} | ||
} | ||
} | ||
const toDir = to | ||
@@ -54,0 +67,0 @@ ? to |
{ | ||
"name": "test-fixture", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "Copy test-fixtures to temp dir and get resolved file paths.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -71,2 +71,3 @@ [![Build Status](https://travis-ci.org/kaelzhang/node-test-fixture.svg?branch=master)](https://travis-ci.org/kaelzhang/node-test-fixture) | ||
- **to?** `path=` the destination folder where the test fixtures will be copied to. If not specified, a temporary directory will be used. | ||
- **clean?** `boolean=false` whether should clean the directory `to` if `options.to` is specified. | ||
- **install?** `boolean=false` whether should run npm install after copying | ||
@@ -73,0 +74,0 @@ |
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
6953
67
127