QA
Installation
npm install directory-fixture-provider --save-dev
Motivation
When your library work with files and directories and you want to test it
Usage
Basics
const fixturesRoot = '/paht/to/your/fixture/directories/files'
const fixtureDirectoryProvider = require('directory-fixture-provider')(fixturesRoot)
const fixtureData = fixtureDirectoryProvider.get('directory2')
This is how you start working with the tool, but the real fun just starts.
So you receive all files and subdirectories of the fixtures that subset what
you were requesting too so in the example above the directory2 will be given back.
We have a random part of the path that is unique per fixture provider, so if you
need clean data, just create another directory-fixture-provider.
Check if your data has changed
const fixtureDirectoryProvider = require('directory-fixture-provider')(fixturesRoot)
const fixtureData = fixtureDirectoryProvider.get('./')
const fixtureDir = fixtureData.dir
fixtureData.getStatus().changed
changeTotals
fixtureData.getStatus().changeTotals
If a new file is added, deleted or an existing changed each counts as a change
here.
changeNumbers
fixtureData.getStatus().changeNumbers
Where it tells you how many files changed, delted or new
If a file is deleted it will increase the changed data tag too.
Milestones
Create an awesome diff module for the getStatus resulting object.
More information
This library helps you find changes modifications between your working and original fixture files. More examples are coming for more information, please check the tests