Skip to content
Closed
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: 2 additions & 0 deletions bin/pa11y-ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Promise.resolve()
.then(config => {
// Load a sitemap based on the `--sitemap` flag
if (commander.sitemap) {
config.urls = [];
return loadSitemapIntoConfig(commander, config);
}
return config;
Expand Down Expand Up @@ -209,6 +210,7 @@ function defaultConfig(config) {
// Load a sitemap from a remote URL, parse out the
// URLs, and add them to an existing config object
function loadSitemapIntoConfig(program, initialConfig) {
console.log('config', initialConfig);
const sitemapFind = (
program.sitemapFind ?
new RegExp(program.sitemapFind, 'gi') :
Expand Down
21 changes: 21 additions & 0 deletions test/integration/cli-sitemap.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,24 @@ describe('pa11y-ci (with a sitemap being sitemapindex)', () => {
});

});

describe('pa11y-ci (with a sitemap being sitemapindex) and config. should ignore config urls', () => {

before(() => {
return global.cliCall([
'--sitemap',
'http://localhost:8090/sitemapindex.xml',
'--config',
'extension-json'
]);
});

it('loads the expected urls from multiple sitemaps', () => {
assert.notInclude(global.lastResult.output, 'http://localhost:8090/config-extension-json');
assert.include(global.lastResult.output, 'http://localhost:8090/passing-1');
assert.include(global.lastResult.output, 'http://localhost:8090/failing-1');
assert.include(global.lastResult.output, 'http://localhost:8090/excluded');
assert.include(global.lastResult.output, 'http://localhost:8090/passing-2');
});

});