Skip to content

Commit 2d3bbec

Browse files
committed
Add tests & travis
1 parent 9841854 commit 2d3bbec

File tree

5 files changed

+45
-1
lines changed

5 files changed

+45
-1
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
language: node_js
2+
node_js:
3+
- '0.10'
4+
- '0.8'

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# gulp-documentation
22

3+
[![build status](https://secure.travis-ci.org/documentationjs/gulp-documentation.png)](http://travis-ci.org/documentationjs/gulp-documentation)
4+
35
Use [gulp](http://gulpjs.com/) with
46
[documentation](https://github.com/documentationjs/documentation)
57
to generate great documentation for your JavaScript projects.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
},
1212
"devDependencies": {
1313
"gulp": "^3.8.11",
14+
"prova": "^2.1.1",
1415
"tape": "^3.5.0"
1516
},
1617
"keywords": [
1718
"documentation",
1819
"gulp",
20+
"gulpplugin",
1921
"jsdoc"
2022
],
2123
"license": "ISC",
@@ -25,6 +27,6 @@
2527
"url": "[email protected]:documentationjs/gulp-documentation.git"
2628
},
2729
"scripts": {
28-
"test": "tape test.js"
30+
"test": "prova test/test.js"
2931
}
3032
}

test/fixture.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* This plugin does foo
3+
* @name foo
4+
*/
5+
function foo() {
6+
return 1;
7+
}
8+
9+
foo();

test/test.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
var test = require('prova'),
2+
path = require('path'),
3+
gulp = require('gulp'),
4+
documentation = require('../');
5+
6+
test('gulp-documentation', function(t) {
7+
t.ok(documentation());
8+
t.end();
9+
});
10+
11+
test('gulp-documentation md', function(t) {
12+
gulp.src(path.join(__dirname, '/fixture.js'))
13+
.pipe(documentation({ format: 'md' }))
14+
.on('data', function(d) {
15+
t.equal(d.path, 'API.md');
16+
t.end();
17+
});
18+
});
19+
20+
test('gulp-documentation md custom name', function(t) {
21+
gulp.src(path.join(__dirname, '/fixture.js'))
22+
.pipe(documentation({ format: 'md', filename: 'foo.md' }))
23+
.on('data', function(d) {
24+
t.equal(d.path, 'foo.md');
25+
t.end();
26+
});
27+
});

0 commit comments

Comments
 (0)