Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional object type overrides #423

Merged
merged 17 commits into from Mar 29, 2018
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
8e2ae9d
Add required object type hooks to support Map plugin.
alexjeffburke Feb 18, 2018
ae23451
Add a property() method to types and use it to replace propertyStyle.
alexjeffburke Feb 18, 2018
6d4854a
Add default valueForKey() impl and test it within the object type.
alexjeffburke Feb 25, 2018
9e9380f
Include additional tests for equal() and getKeys() type methods.
alexjeffburke Feb 25, 2018
d1ea1e3
Check undefined values in equal() with valueForKey.
alexjeffburke Feb 25, 2018
224ad6b
Add a hasKey() type method.
alexjeffburke Feb 25, 2018
14a5e79
Adjust "to satisfy" assertion to make use of type hasKey and valueFor…
alexjeffburke Feb 25, 2018
85736e6
Convert array-like inspect and diff to respect valueForKey().
alexjeffburke Feb 25, 2018
0dc72a9
Rework array-like "to satisfy" assertion with hooks support.
alexjeffburke Mar 4, 2018
cf5de21
Ensure the keyComparator defaults to undefined.
alexjeffburke Mar 6, 2018
a0d26f3
Pass a cloned output to subjectType.property() calls.
alexjeffburke Mar 25, 2018
c1bdb3e
Add additional test for array-like custom inspection.
alexjeffburke Mar 25, 2018
3766b9b
Update assertions case missed in a0d26f3 & tweak a couple of blocks.
alexjeffburke Mar 25, 2018
a60873f
Pass over types for cloned output to type.property() calls.
alexjeffburke Mar 26, 2018
009a252
Fix missed valueForKey conversion in array-like satisfy and add test.
alexjeffburke Mar 27, 2018
d1f0114
Convert a number of additional object assertions to valueForKey.
alexjeffburke Mar 27, 2018
505c32b
Rework duplicateArrayLikeUsingType() so it uses the type getKeys.
alexjeffburke Mar 29, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
304 changes: 163 additions & 141 deletions lib/assertions.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion lib/styles.js
Expand Up @@ -122,7 +122,11 @@ module.exports = expect => {
.jsString("'");
});

expect.addStyle('property', function(key, inspectedValue, isArrayLike) {
expect.addStyle('propertyForObject', function(
key,
inspectedValue,
isArrayLike
) {
let keyOmitted = false;
let isSymbol;
isSymbol = typeof key === 'symbol';
Expand Down