Skip to content
Open
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
20 changes: 10 additions & 10 deletions features/step_definitions/a11y_steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ When('I answer {string}', function (answer) {

Then('the manual test fails', function () {
return this.countAllErrors()
.then(count => assert.notEqual(count, 0))
.then(count => assert.notStrictEqual(count, 0))
})

Then('the manual test passes', function () {
return this.countAllErrors()
.then(count => assert.equal(count, 0))
.then(count => assert.strictEqual(count, 0))
})

When('my page configuration is:', function (string) {
Expand All @@ -123,7 +123,7 @@ When('I test the {string} standard', function (name) {

Then('it passes', function () {
if ('exitCode' in this) {
assert.equal(this.exitCode, 0, '\n' + this.stdout + this.stderr)
assert.strictEqual(this.exitCode, 0, '\n' + this.stdout + this.stderr)
} else {
const resultsWithErrors = this.outcome.results.filter(function (result) {
return result.errors.length > 0
Expand All @@ -146,7 +146,7 @@ Then('it passes with the warning:', function (message) {
}).join(' ')
}).join('\n')
}).join('\n')
assert.equal(actualMessage, message)
assert.strictEqual(actualMessage, message)
})

Then('it should fail with:', function (expectedOutput) {
Expand All @@ -167,15 +167,15 @@ Then('it should fail with exactly:', function (expectedOutput) {
console.log(sanitisedActualOutput)
process.exit(1)
}
assert.equal(sanitisedActualOutput, expectedOutput, 'Expected:\n' + expectedOutput.replace(/\n/g, '[\\n]\n') + '\nActual:\n' + sanitisedActualOutput.replace(/\n/g, '[\\n]\n'))
assert.strictEqual(sanitisedActualOutput, expectedOutput, 'Expected:\n' + expectedOutput.replace(/\n/g, '[\\n]\n') + '\nActual:\n' + sanitisedActualOutput.replace(/\n/g, '[\\n]\n'))
})

Then('it should pass with:', function (string) {
const actualOutput = (this.stdout + this.stderr)
if (actualOutput.indexOf(string) === -1) {
throw new Error('Expected:\n' + string + '\nActual:\n' + actualOutput)
}
assert.equal(this.exitCode, 0)
assert.strictEqual(this.exitCode, 0)
})

Then('it fails with the message:', function (message) {
Expand All @@ -188,11 +188,11 @@ Then('it fails with the message:', function (message) {
}).join(' ')
}).join('\n')
}).join('\n')
assert.equal(actualMessage, message)
assert.strictEqual(actualMessage, message)
})

Then('the exit status should be {int}', function (status) {
assert.equal(this.exitCode, status)
assert.strictEqual(this.exitCode, status)
})

Then('the window should remain open', function () {
Expand Down Expand Up @@ -221,10 +221,10 @@ When('I answer all questions except one with a pass', function () {

Then('it should result in a pass for {url}', function (url) {
return this.countManualTestErrors(url)
.then(count => assert.equal(count, 0))
.then(count => assert.strictEqual(count, 0))
})

Then('it should result in a fail for {url}', function (url) {
return this.countErrorsForUrl(url)
.then(count => assert.notEqual(count, 0))
.then(count => assert.notStrictEqual(count, 0))
})
3 changes: 2 additions & 1 deletion lib/cli/args.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ module.exports = {
.option('-r, --reporter <reporter>', 'json or [path to custom reporter module]')
.option('--coverage <list|table>', 'lists all tests with a description of each test')
.parse(argv)
.opts()

return {
interactive: !!opts.interactive,
manual: !!opts.manual,
urls: opts.args,
urls: commander.args, // remaining unprocessed arguments can be found here
width: opts.width,
configPath: opts.config,
reporter: opts.reporter,
Expand Down
44 changes: 7 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"generate-coverage": "./scripts/generate-coverage"
},
"dependencies": {
"commander": "5.1.0",
"commander": "7.2.0",
"electron": "13.5.2",
"jquery": "3.7.1"
},
Expand Down
8 changes: 4 additions & 4 deletions test/commandLineArgsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ const assert = require('assert')
describe('commandLineArgs.parse(argv)', function () {
it('parses --width integer as viewport width', function () {
const args = commandLineArgs.parse(['node', 'bbc-a11y', '--width', '777'])
assert.equal(777, args.width)
assert.strictEqual(777, args.width)
})

it('parses --interactive as a boolean', function () {
const args = commandLineArgs.parse(['node', 'bbc-a11y', '--interactive'])
assert.equal(true, args.interactive)
assert.strictEqual(true, args.interactive)
})

it('parses --config as a string', function () {
const args = commandLineArgs.parse(['node', 'bbc-a11y', '--config', 'foo'])
assert.equal('foo', args.configPath)
assert.strictEqual('foo', args.configPath)
})

it('parses all other arguments as URLs', function () {
const args = commandLineArgs.parse(['node', 'bbc-a11y', 'foo', 'bar'])
assert.deepEqual(['foo', 'bar'], args.urls)
assert.deepStrictEqual(['foo', 'bar'], args.urls)
})
})
14 changes: 7 additions & 7 deletions test/configSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('configLoader.loadConfigFromPath(pathToConfigModule)', function () {
it('resolves with a list of pages', function () {
return configLoader.loadConfigFromPath(pathToConfigModule('simple'))
.then(function (config) {
assert.deepEqual(config, {
assert.deepStrictEqual(config, {
pages: [
{ url: 'https://www.bbc.co.uk' },
{ url: 'https://www.bbc.co.uk/news' }
Expand All @@ -26,7 +26,7 @@ describe('configLoader.loadConfigFromPath(pathToConfigModule)', function () {
it('resolves with a list of pages', function () {
return configLoader.loadConfigFromPath(pathToConfigModule('skipAndOnly'))
.then(function (config) {
assert.deepEqual(config, {
assert.deepStrictEqual(config, {
pages: [
{ url: 'https://www.bbc.co.uk', skip: ['x'] },
{ url: 'https://www.bbc.co.uk/news', skip: ['y', 'z'] },
Expand All @@ -42,7 +42,7 @@ describe('configLoader.loadConfigFromPath(pathToConfigModule)', function () {
it('resolves with a list of pages', function () {
return configLoader.loadConfigFromPath(pathToConfigModule('viewportWidth'))
.then(function (config) {
assert.deepEqual(config, {
assert.deepStrictEqual(config, {
pages: [
{ url: 'https://www.bbc.co.uk', width: 789 }
]
Expand All @@ -58,7 +58,7 @@ describe('configLoader.loadConfigFromPath(pathToConfigModule)', function () {
throw new Error('Expected a rejection')
})
.catch(function (e) {
assert.equal("Unexpected token '>'", e.message)
assert.strictEqual("Unexpected token '>'", e.message)
})
})
})
Expand All @@ -80,7 +80,7 @@ describe('configLoader.loadConfigFromPath(pathToConfigModule)', function () {
it('resets page to its previous value', function () {
return configLoader.loadConfigFromPath(pathToConfigModule('empty'))
.then(function () {
assert.equal(666, global.page)
assert.strictEqual(666, global.page)
})
})
})
Expand All @@ -89,10 +89,10 @@ describe('configLoader.loadConfigFromPath(pathToConfigModule)', function () {
it('resets page to its previous value', function () {
return configLoader.loadConfigFromPath(pathToConfigModule('syntaxError'))
.then(function () {
assert.equal(666, global.page)
assert.strictEqual(666, global.page)
})
.catch(function () {
assert.equal(666, global.page)
assert.strictEqual(666, global.page)
})
})
})
Expand Down
8 changes: 4 additions & 4 deletions test/runnerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ describe('Runner', function () {
return run([{ url: 'https://example.com/' }])
.then(function (events) {
const firstEventPayload = JSON.parse(events[0].args[0])
assert.deepEqual(firstEventPayload.pagesChecked, 1)
assert.deepEqual(events[events.length - 1], { type: 'exit', args: [1] })
assert.deepStrictEqual(firstEventPayload.pagesChecked, 1)
assert.deepStrictEqual(events[events.length - 1], { type: 'exit', args: [1] })
})
}).timeout(10000)
})
Expand All @@ -91,8 +91,8 @@ describe('Runner', function () {
return run([], configPath)
.then(function (events) {
const firstEventPayload = JSON.parse(events[0].args[0])
assert.deepEqual(firstEventPayload.pagesChecked, 2)
assert.deepEqual(events[events.length - 1], { type: 'exit', args: [1] })
assert.deepStrictEqual(firstEventPayload.pagesChecked, 2)
assert.deepStrictEqual(events[events.length - 1], { type: 'exit', args: [1] })
})
}).timeout(10000)
})
Expand Down
2 changes: 1 addition & 1 deletion test/sectionsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Standards.sections', function () {
const urls = {}
for (const name in sections) {
const section = sections[name]
assert.equal(typeof section.documentationUrl, 'string')
assert.strictEqual(typeof section.documentationUrl, 'string')
if (urls[section.documentationUrl]) assert.fail('duplicate: ' + section.documentationUrl)
urls[section.documentationUrl] = true
}
Expand Down
Loading