ava-fixture
This library helps you to write fixture tests: test-per-folder or test-per-file.
Usage
For example, you are testing code that process files (e.g. a compiler, config-reader, etc).
You put each test case inside its own folder:
+ fixtures + cases + empty - somefiles + basic-
You can run each test case like this:
;; // Point to the base folder which contain the fixtures.// Use relative path starts from project root or absolute path; ftest.each
You can also use this library to run tests that only read files:
;; // Point to the base folder which contain the fixtures.// Relative path starts from project root.; ftest'test title', 'case-1',; // test title can be omittedftest'case-1', // go through each testftest.each // or run certain test based on filterftest.each/some filter/,
Other API
;; ; ftest.only...ftest.skip...ftest.failing...ftest.only.each.failing...
For before()
, beforeEach()
, after()
, afterEach()
, todo()
, use ava
directly.
Contribute
# right after clone npm install # begin making changes git checkout -b <branch>npm run watch # edit `webpack.config.es5.js` and `rollup.config.es2015.js` to exclude dependencies for the bundle if needed # after making change(s) git commit -m "<commit message>"git push # create PR
Npm Commands
There are a few useful commands you can use during development.
# Run tests (and lint) automatically whenever you save a file. npm run watch # Run tests with coverage stats (but won't fail you if coverage does not meet criteria) npm run test # Manually verify the project. # This will be ran during 'npm preversion' so you normally don't need to run this yourself. npm run verify # Build the project. # You normally don't need to do this. npm run build # Run tslint # You normally don't need to do this as `npm run watch` and `npm version` will automatically run lint for you. npm run lint
Generated by generator-unional@0.9.0