core3-utils

npm version @wixc3/mostly-equal on Github

Home > @wixc3/mostly-equal

mostly-equal package

Adds chai matches for partial equality of JSONs

Example

 import chai, { expect } from 'chai';
 import {mostlyEqlChaiPlugin, notImportant} from '@wixc3/mostly-equal'
 chai.use(mostlyEqlChaiPlugin)
 expect({a: 1}).to.mostlyEqual({
          a: 1,
      b: notImportant,
  });

Functions

Function Description
[allowMarkersInFactory(f)](/core3-utils/mostly-equal.allowmarkersinfactory.html)
[checkExpectValues(input, formatters)](/core3-utils/mostly-equal.checkexpectvalues.html)
[clearMatchedValues(subMatcher)](/core3-utils/mostly-equal.clearmatchedvalues.html)
[defineSame(name, skipUndefined)](/core3-utils/mostly-equal.definesame.html) Creates a symbol for usage in mostlyEqual, Comparing the resulting value in any place it is used as the value
[defineUnique(name, skipUndefined)](/core3-utils/mostly-equal.defineunique.html) Creates a symbol for usage in expect.mostlyEqual, Comparing the resulting value in any place it is used as the value
[equal(value, thumbsUpOnSuccess)](/core3-utils/mostly-equal.equal.html) Strict equality of a field
[errorString(expected, actual, maxDepth, formatters, depth, path, passedMap, passedSet)](/core3-utils/mostly-equal.errorstring.html)
[expectValue(expectMethod)](/core3-utils/mostly-equal.expectvalue.html) Used for adding field matchers to mostlyEqual Creates a symbol used for field matching
[expectValues(expectMethod, allowUndefined)](/core3-utils/mostly-equal.expectvalues.html) Similar to [expectValue()](/core3-utils/mostly-equal.expectvalue.html), but called for all the matches at once. This way a matcher can compare different values [defineUnique()](/core3-utils/mostly-equal.defineunique.html)
[getMatchedValues(expectValues)](/core3-utils/mostly-equal.getmatchedvalues.html)
[HTMLFormatter(Element)](/core3-utils/mostly-equal.htmlformatter.html)
[isExpectVal(val)](/core3-utils/mostly-equal.isexpectval.html)
[isExpectValues(val)](/core3-utils/mostly-equal.isexpectvalues.html)
[isGetter(target, key)](/core3-utils/mostly-equal.isgetter.html)
[isPlainObj(value)](/core3-utils/mostly-equal.isplainobj.html)
[printPath(p)](/core3-utils/mostly-equal.printpath.html)
[registerChildSet(target, path, passedMap, passedSet)](/core3-utils/mostly-equal.registerchildset.html)
[safePrint(target, maxDepth, formatters, depth, passedMap, passedSet, path)](/core3-utils/mostly-equal.safeprint.html)
[setGlobalOptions(maxDepth, formatters)](/core3-utils/mostly-equal.setglobaloptions.html)
[setSuiteOptions(before, after, options)](/core3-utils/mostly-equal.setsuiteoptions.html)
[spaces(indent)](/core3-utils/mostly-equal.spaces.html)

Interfaces

Interface Description
[ExpectValue](/core3-utils/mostly-equal.expectvalue.html)
[ExpectValues](/core3-utils/mostly-equal.expectvalues.html)
[ExpectValuesInfo](/core3-utils/mostly-equal.expectvaluesinfo.html)
[Formatter](/core3-utils/mostly-equal.formatter.html)
[MostlyEqualOptions](/core3-utils/mostly-equal.mostlyequaloptions.html)
[PseudoElement](/core3-utils/mostly-equal.pseudoelement.html)

Variables

Variable Description
[defined](/core3-utils/mostly-equal.defined.html) Field must be defined (null is considered define)
[expectValuesSymb](/core3-utils/mostly-equal.expectvaluessymb.html)
[expectValueSymb](/core3-utils/mostly-equal.expectvaluesymb.html)
[mostlyEqlChaiPlugin](/core3-utils/mostly-equal.mostlyeqlchaiplugin.html)
[notImportant](/core3-utils/mostly-equal.notimportant.html)
[thumbsUp](/core3-utils/mostly-equal.thumbsup.html)

Type Aliases

Type Alias Description
[AllowMarkers](/core3-utils/mostly-equal.allowmarkers.html)
[AllowMarkersObj](/core3-utils/mostly-equal.allowmarkersobj.html)
[ErrorOrText](/core3-utils/mostly-equal.errorortext.html)
[ErrorOrTextOrExpect](/core3-utils/mostly-equal.errorortextorexpect.html)
[ExpandedValues](/core3-utils/mostly-equal.expandedvalues.html)
[ExpectMultiMatcher](/core3-utils/mostly-equal.expectmultimatcher.html)
[ExpectSingleMatcher](/core3-utils/mostly-equal.expectsinglematcher.html)
[LookupPath](/core3-utils/mostly-equal.lookuppath.html)
[MarkerSymbol](/core3-utils/mostly-equal.markersymbol.html)
[PseudoElementConstructor](/core3-utils/mostly-equal.pseudoelementconstructor.html)
[UnknownObjectRecord](/core3-utils/mostly-equal.unknownobjectrecord.html)