-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add `toMatchImageSnapshot` command * Made creating "diff image" optional by adding `createDiffImage` to `imageConfig` * Fix `toMatchImageSnapshot` tests * Add automatic resizing for high DPI (Retina screens) * Fix unpublished `[email protected]` package * Fix tests on Travis * Fix imageConfig is undefined and move `resizeImage` to seperate file * Fix sharp * Travis: trying to use internal travis GCC * Use Jimp * Fix jest test * Remove exploited event-stream version * Run tests in Chrome * Increase threshold to see if this fixes it on Travis
- Loading branch information
Showing
73 changed files
with
4,654 additions
and
1,641 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.DS_Store | ||
node_modules | ||
/cypress/cypress/screenshots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
|
||
describe('utils/keepKeysFromExpected', () => { | ||
const expected = { | ||
field: "value", | ||
items: [ | ||
{name: "item1", "items": [{name: "subitem1"}]}, | ||
{name: "item2"}, | ||
{name: "item3"}, | ||
] | ||
}; | ||
|
||
const actual = { | ||
field: "value", | ||
extra: "extra", | ||
items: [ | ||
{name: "item1", "items": [{name: "subitem1", extra: 'extra1'}, {name: "subitem2", extra: 'extra2'}]}, | ||
{name: "item2"}, | ||
{name: "item3"}, | ||
{name: "item4"}, | ||
] | ||
}; | ||
|
||
it('ignoreExtraFields: false, ignoreExtraArrayItems: false', () => { | ||
const config = { | ||
ignoreExtraFields: false, | ||
ignoreExtraArrayItems: false, | ||
}; | ||
const keepKeysFromExpected = require('../../src/utils/keepKeysFromExpected'); | ||
const result = keepKeysFromExpected(actual, expected, config); | ||
expect(result).toMatchSnapshot(); | ||
}); | ||
|
||
it('ignoreExtraFields: true, ignoreExtraArrayItems: false', () => { | ||
const config = { | ||
ignoreExtraFields: true, | ||
ignoreExtraArrayItems: false, | ||
}; | ||
const keepKeysFromExpected = require('../../src/utils/keepKeysFromExpected'); | ||
const result = keepKeysFromExpected(actual, expected, config); | ||
expect(result).toMatchSnapshot(); | ||
}); | ||
|
||
it('ignoreExtraFields: true, ignoreExtraArrayItems: true', () => { | ||
const config = { | ||
ignoreExtraFields: true, | ||
ignoreExtraArrayItems: true, | ||
}; | ||
const keepKeysFromExpected = require('../../src/utils/keepKeysFromExpected'); | ||
const result = keepKeysFromExpected(actual, expected, config); | ||
expect(result).toMatchSnapshot(); | ||
}); | ||
|
||
it('ignoreExtraFields: false, ignoreExtraArrayItems: true', () => { | ||
const config = { | ||
ignoreExtraFields: false, | ||
ignoreExtraArrayItems: true, | ||
}; | ||
const keepKeysFromExpected = require('../../src/utils/keepKeysFromExpected'); | ||
const result = keepKeysFromExpected(actual, expected, config); | ||
expect(result).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.