Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.

Commit 6e7c408

Browse files
author
Katy DeCorah
authored
assert documentation exists when mapboxjs version is bumped in production config (#1309)
1 parent 157fc7d commit 6e7c408

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"sanitize-caja": "0.1.4"
2222
},
2323
"scripts": {
24-
"test": "eslint src && phantomjs node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js test/index.html",
24+
"test": "eslint src && phantomjs node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js test/index.html && mocha test/docs.js",
2525
"prepublishOnly": "npm run build",
2626
"build": "make"
2727
},

test/docs.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// makes sure documentation is generated when `mapboxjs: v#.#.#` is updated in _config.publisher-production.yml
2+
var fs = require('fs');
3+
var jsyaml = require('js-yaml');
4+
var assert = require('assert');
5+
6+
// get mapbox.js version from config
7+
var config = fs.readFileSync('./_config.publisher-production.yml');
8+
var yaml = jsyaml.load(config);
9+
var mapboxjs = yaml.mapboxjs;
10+
// assert that that docs/_posts/api/v#.#.# exists
11+
describe('Documentation is generated', function() {
12+
it('Documentation for ' + mapboxjs + ' exists', function() {
13+
assert.equal(fs.existsSync('./docs/_posts/api/' + mapboxjs), true);
14+
});
15+
});

0 commit comments

Comments
 (0)