# vinyl-fs-mock

> A fake file system implementation, used for test code written based on vinyl and vinyl-fs. Including gulp plugins

Latest version **0.1.2** (published 2014-07-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install vinyl-fs-mock
pnpm add vinyl-fs-mock
yarn add vinyl-fs-mock
bun add vinyl-fs-mock
```

## Health

**Score 5/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2014-07-17 |
| First published | 2014-07-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+10 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | timnew |
| Maintainers | timnew |
| Keywords | gulp, gulp-plugin, vinyl, vinyl-fs, mock, fake, test, file, file system |

## Links

- npm: https://www.npmjs.com/package/vinyl-fs-mock
- Repository: https://github.com/timnew/gulp-mock-fs
- Issues: https://github.com/timnew/gulp-mock-fs/issues
- npm.io page: https://npm.io/package/vinyl-fs-mock

## Dependencies (7)

- [vinyl](https://npm.io/package/vinyl.md) ^0.2.3
- [lodash](https://npm.io/package/lodash.md) ^2.4.1
- [glob2base](https://npm.io/package/glob2base.md) git://github.com/timnew/glob2base.git#master
- [minimatch](https://npm.io/package/minimatch.md) ^0.4.0
- [type-of-is](https://npm.io/package/type-of-is.md) ^3.3.0
- [util-deprecate](https://npm.io/package/util-deprecate.md) ^1.0.0
- [readable-stream](https://npm.io/package/readable-stream.md) ^1.0.27-1

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2014-07-17
- 0.1.1 — 2014-07-13
- 0.1.0 — 2014-07-13

## README

vinyl-fs-mock [![NPM version][npm-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Dependency Status][depstat-image]][depstat-url]
================

> A fake file system implementation, used for test code written based on [vinyl]() and [vinyl-fs](). 
> Useful for [gulp]() plugin unit test. 
> With [vinyl-fs-mock][homepage], all the file fixtures can be provided inline. So not more external fixtures needed.

## Install

Install using [npm][npm-url].

    $ npm install vinyl-fs-mock

## Usage

```coffeescript

require('./spec_helper')

describe 'smoke test', ->
  createFS = require('../index')
  coffee = require('gulp-coffee')
  
  it 'should mock gulp', (done) ->  
    fs = createFS
          src:
            coffee:
              'sample.coffee': """
                console.log 'Hello world'
              """
              'another.coffee': """
                fib = (n) ->
                  switch n
                    when 0, 1
                      1
                    else
                      fib(n) + fib(n-1)  
              """
        
    fs.src 'src/coffee/*.coffee'
      .pipe coffee
        bare: true
      .pipe fs.dest 'dest/js'
      .onFinished done, (folder) ->
        # console.log fs.directory  # Display whole tree of files
        folder.should.equal fs.openFolder('dest/js')                
        folder['sample.js'].should.not.be.null
        folder['another.js'].should.not.be.null
      
```

`vinyl-fs-mock` is being used in the unit tests for [gulp-tree-concat](https://github.com/timnew/gulp-tree-concat). 

Check [concat_javascripts.spec.coffee](https://github.com/timnew/gulp-tree-concat/blob/master/specs/concat_javascripts.spec.coffee) for more detail


## API

> TODO
 
## License
MIT

[![NPM downloads][npm-downloads]][npm-url]

[homepage]: https://github.com/timnew/vinyl-fs-mock

[npm-url]: https://npmjs.org/package/vinyl-fs-mock
[npm-image]: http://img.shields.io/npm/v/vinyl-fs-mock.svg?style=flat
[npm-downloads]: http://img.shields.io/npm/dm/vinyl-fs-mock.svg?style=flat

[ci-url]: https://drone.io/github.com/timnew/vinyl-fs-mock/latest
[ci-image]: https://drone.io/github.com/timnew/vinyl-fs-mock/status.png

[depstat-url]: https://gemnasium.com/timnew/vinyl-fs-mock
[depstat-image]: http://img.shields.io/gemnasium/timnew/vinyl-fs-mock.svg?style=flat

---
_Source: https://npm.io/package/vinyl-fs-mock · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
