Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"sanitize-caja": "0.1.4"
},
"scripts": {
"test": "eslint src && phantomjs node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js test/index.html",
"test": "eslint src && phantomjs node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js test/index.html && mocha test/docs.js",
"prepublishOnly": "npm run build",
"build": "make"
},
Expand Down
15 changes: 15 additions & 0 deletions test/docs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// makes sure documentation is generated when `mapboxjs: v#.#.#` is updated in _config.publisher-production.yml
var fs = require('fs');
var jsyaml = require('js-yaml');
var assert = require('assert');

// get mapbox.js version from config
var config = fs.readFileSync('./_config.publisher-production.yml');
var yaml = jsyaml.load(config);
var mapboxjs = yaml.mapboxjs;
// assert that that docs/_posts/api/v#.#.# exists
describe('Documentation is generated', function() {
it('Documentation for ' + mapboxjs + ' exists', function() {
assert.equal(fs.existsSync('./docs/_posts/api/' + mapboxjs), true);
});
});