Skip to content

Commit

Permalink
fix way of calling nightwatch assertion utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
enriquecastl committed Aug 4, 2017
1 parent 66860aa commit aeffe39
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
7 changes: 1 addition & 6 deletions lib/get-vrt-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,19 @@ module.exports = function getVrtSettings(nightwatchClient) {
if (visualRegressionSettings) {
nightwatchClient.assert.ok(
typeof(get(visualRegressionSettings, 'baseline_screenshots_path', null)) === 'string',
'string',
null,
'You must define a baseline screenshot directory path.'
)
nightwatchClient.assert.ok(
typeof(get(visualRegressionSettings, 'failed_screenshots_path', null)) === 'string',
'string',
null,
'You must define a failed screenshot directory path.'
)
} else {
nightwatchClient.assert.ok(
visualRegressionSettings,
'Object',
null,
'Could not access the visual regression settings. Make sure you define a visual_regression_settings property in your nightwatch configuration file.'
)
}


return visualRegressionSettings
}
6 changes: 0 additions & 6 deletions tests/lib/get-vrt-settings-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ describe('getVrtSettings', () => {

expect(calls.length).toEqual(1)
expect(calls[0]).toEqual([
null,
'Object',
null,
'Could not access the visual regression settings. Make sure you define a visual_regression_settings property in your nightwatch configuration file.'
])
Expand All @@ -45,8 +43,6 @@ describe('getVrtSettings', () => {
const calls = nightwatchClient.assert.ok.mock.calls
expect(calls[0]).toEqual([
false,
'string',
null,
'You must define a baseline screenshot directory path.'
])
})
Expand All @@ -67,8 +63,6 @@ describe('getVrtSettings', () => {
const calls = nightwatchClient.assert.ok.mock.calls
expect(calls[1]).toEqual([
false,
'string',
null,
'You must define a failed screenshot directory path.'
])
})
Expand Down

0 comments on commit aeffe39

Please sign in to comment.