Skip to content

Commit

Permalink
test: require new release rule help docs to be active before creating…
Browse files Browse the repository at this point in the history
… release (#1700)

* tests: require new release rule help docs to be active before creating release

* use underscores

* update comment

* update comment

* use split

* add test_rule_help_version to workflows
  • Loading branch information
straker authored Jul 15, 2019
1 parent 02aa36c commit e9f9c18
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ jobs:
- run: npm run build
- run: npm run test:locales

# Test newest axe-core version rule help docs are active (only on
# master prs)
test_rule_help_version:
<<: *defaults
steps:
- checkout
- <<: *restore_dependency_cache
- run: npm run test:rule-help-version

# Release a "next" version
next_release:
<<: *defaults
Expand Down Expand Up @@ -129,13 +138,17 @@ workflows:
- test_locales:
requires:
- test
- test_rule_help_version:
requires:
- test
# Hold for approval
- hold:
type: approval
requires:
- test
- test_examples
- test_locales
- test_rule_help_version
filters:
branches:
only:
Expand All @@ -157,6 +170,7 @@ workflows:
- test
- test_examples
- test_locales
- test_rule_help_version
- hold
filters:
branches:
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"test": "npm run retire && tsc && grunt test",
"test:examples": "node ./doc/examples/test-examples",
"test:locales": "mocha test/test-locales.js",
"test:rule-help-version": "mocha test/test-rule-help-version.js",
"version": "echo \"use 'npm run release' to bump axe-core version\" && exit 1",
"prepublishOnly": "grunt build && grunt file-exists",
"retire": "retire --jspath lib --nodepath ./ --ignorefile .retireignore.json --severity medium",
Expand Down
19 changes: 19 additions & 0 deletions test/test-rule-help-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
var https = require('https');
var path = require('path');
var assert = require('assert');
var packageJSON = require(path.join(__dirname, '../package.json'));

var versions = packageJSON.version.split('.');
var version = versions[0] + '.' + versions[1];

it(
'latest axe version (' + version + ') rule help docs should be active',
function(done) {
https.get('https://dequeuniversity.com/rules/axe/' + version, function(
res
) {
assert(res.statusCode >= 200 && res.statusCode <= 299);
done();
});
}
);

0 comments on commit e9f9c18

Please sign in to comment.