Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

test-fixture

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

test-fixture - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

5

index.js

@@ -24,2 +24,6 @@ const path = require('path')

get root () {
return this._root
}
resolve (...args) {

@@ -81,1 +85,2 @@ return args.length === 0

module.exports = (...args) => new Fixtures(...args)
module.exports.Fixtures = Fixtures

2

package.json
{
"name": "test-fixture",
"version": "2.2.0",
"version": "2.3.0",
"description": "Copy test-fixtures to temp dir and get resolved file paths.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -43,3 +43,3 @@ [![Build Status](https://travis-ci.org/kaelzhang/node-test-fixture.svg?branch=master)](https://travis-ci.org/kaelzhang/node-test-fixture)

### fixtures(...paths): {resolve, copy, install}
### fixtures(...paths): {resolve, copy, install, root}

@@ -67,2 +67,19 @@ - **paths** `Array<path>` to define the root paths of the fixtures, which is similar as

#### Without copying
```js
const {resolve} = fixtures(base)
resolve('a.js') // -> /path/to/<base>/a.js
```
#### Using `.copy()`
```js
const {copy, resolve} = fixtures(base)
await copy('/path/to')
resolve('a.js') // -> /path/to/a.js
```
### await copy(options?)

@@ -109,21 +126,8 @@ ### await copy(to?)

#### Without copying
### getter: root `string`
```js
const {resolve} = fixtures(base)
resolve('a.js') // -> /path/to/<base>/a.js
```
The fixture root `/<project-root>/test/fixtures`
#### Using `.copy()`
```js
const {copy, resolve} = fixtures(base)
await copy('/path/to')
resolve('a.js') // -> /path/to/a.js
```
## License
[MIT](LICENSE)
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