MCPcopy
hub / github.com/remix-run/remix / assertCompatibleError

Function assertCompatibleError

packages/assert/src/lib/assert.test.ts:788–806  ·  view source on GitHub ↗
(
  ours: nodeAssert.AssertionError | null,
  nodes: nodeAssert.AssertionError | null,
)

Source from the content-addressed store, hash-verified

786}
787
788function assertCompatibleError(
789 ours: nodeAssert.AssertionError | null,
790 nodes: nodeAssert.AssertionError | null,
791) {
792 nodeAssert.equal(ours === null, nodes === null, 'throw/pass disagrees with node:assert/strict')
793 if (ours && nodes) {
794 nodeAssert.equal(ours.name, nodes.name)
795 nodeAssert.equal(ours.code, nodes.code)
796 // Bun's node:assert shim omits diagnostic fields for some newer assertions.
797 if (nodes.operator === undefined) {
798 return
799 }
800
801 nodeAssert.equal(ours.operator, nodes.operator)
802 nodeAssert.equal(ours.generatedMessage, nodes.generatedMessage)
803 nodeAssert.deepEqual(ours.actual, nodes.actual)
804 nodeAssert.deepEqual(ours.expected, nodes.expected)
805 }
806}

Callers 1

assert.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…