Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/timjgleeson/stylus-test-runner
DSL for testing your stylus source code
https://github.com/timjgleeson/stylus-test-runner
Last synced: 3 months ago
JSON representation
DSL for testing your stylus source code
- Host: GitHub
- URL: https://github.com/timjgleeson/stylus-test-runner
- Owner: timjgleeson
- Created: 2014-02-24T02:25:46.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-04-17T03:20:41.000Z (over 10 years ago)
- Last Synced: 2024-07-24T12:29:59.503Z (4 months ago)
- Language: JavaScript
- Size: 249 KB
- Stars: 4
- Watchers: 2
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# stylus-test-runner
DSL for testing your stylus source code
### Install
```
npm install stylus-test-runner
```### Api
In your stylus repo, add the following ```.js``` file
```
var testRunnerConfig = {
testDirPath: '{{path to testing directory}}',
stylus: {
use: require('{{path to stylus.js include}}')(),
import: '{{path to stylus.styl include}}'
}
}require('stylus-test-runner')(testRunnerConfig)
```In a ```.styl```, include the following.
```
// @describe This is a description
// @it This is the stylus being tested
// @expect This is the outputs css expected
// @throws Expect the test to throw an error
```### Preview
```
// @describe clearfix()// @it should output a clearfix styles to an element
.class
clearfix()// @expect
.class:after,
.class:before {
content: "";
display: table;
}
.class:after {
clear: both;
}
```
```
$ node test/test-runner.jsclearfix()
✓ should output a clearfix styles to an element (136ms)
```