Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kellyselden/fixture-skipper
skip fixture tests with "_" prefix
https://github.com/kellyselden/fixture-skipper
Last synced: 16 days ago
JSON representation
skip fixture tests with "_" prefix
- Host: GitHub
- URL: https://github.com/kellyselden/fixture-skipper
- Owner: kellyselden
- License: apache-2.0
- Created: 2017-09-17T16:16:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-02-23T16:31:39.000Z (almost 5 years ago)
- Last Synced: 2025-01-02T05:44:01.362Z (24 days ago)
- Language: JavaScript
- Size: 32.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fixture-skipper
[![Greenkeeper badge](https://badges.greenkeeper.io/kellyselden/fixture-skipper.svg)](https://greenkeeper.io/)
[![npm version](https://badge.fury.io/js/fixture-skipper.svg)](https://badge.fury.io/js/fixture-skipper)
[![Build Status](https://travis-ci.org/kellyselden/fixture-skipper.svg?branch=master)](https://travis-ci.org/kellyselden/fixture-skipper)skip fixture tests with "_" prefix
If you are dynamically running tests based on folders of fixture files, there is no easy way to `it.only` or run only one test while debugging. Now you can prefix one of your fixture folders with "_", and it will be the only test that runs.
```js
const path = require('path');
const fixtureSkipper = require('fixture-skipper');const fixturesPath = 'test/fixtures';
// with folders "1", "2", "3", all tests run
// with folders "1", "2", "_3", only "_3" runsconst forEachDir = fixtureSkipper(fixturesPath);
describe('my tests', function() {
forEachDir((it, fixturesDir) => {
it(`testing fixtures: ${fixturesDir}`, function() {
let fixtures = fixturify.readSync(path.join(fixturesPath, fixturesDir));// test using your fixtures
});
});
});
```