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

Commit

Permalink
assert documentation exists when mapboxjs version is bumped in produc…
Browse files Browse the repository at this point in the history
…tion config (#1309)
  • Loading branch information
Katy DeCorah authored Oct 18, 2019
1 parent 157fc7d commit 6e7c408
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
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);
});
});

0 comments on commit 6e7c408

Please sign in to comment.