Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jpommerening/node-markdown-bdd
Use code blocks from markdown documents in your tests
https://github.com/jpommerening/node-markdown-bdd
Last synced: 24 days ago
JSON representation
Use code blocks from markdown documents in your tests
- Host: GitHub
- URL: https://github.com/jpommerening/node-markdown-bdd
- Owner: jpommerening
- License: mit
- Created: 2014-05-27T19:22:57.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-29T14:10:21.000Z (about 10 years ago)
- Last Synced: 2024-09-15T04:39:39.581Z (2 months ago)
- Language: JavaScript
- Size: 164 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT
Awesome Lists containing this project
README
# markdown-bdd
> Use code blocks from markdown documents in your tests.
Take this README file for example. There are multiple code blocks
in here, that serve as usage examples for the user.
However, since these examples are supposed to _describe_ what the
module does, why not go ahead and use them as the specification?## Usage Example
Ok, hang on, I'll explain later. First have a look at this example:
```js
var markdownBdd = require('markdown-bdd');// declare what to use as input and what global variables to assume
var example = markdownBdd('README.md', {
describe: describe,
example: function() {},
it: it
});describe('markdown-bdd', function() {
example('Usage Example', function() {
it('should be runnable with mocha', function (done) {
// ...
});
});
});
```