MCPcopy
hub / github.com/josdejong/mathjs / maybeCheckExpectation

Function maybeCheckExpectation

test/node-tests/doc.test.js:124–144  ·  view source on GitHub ↗
(name, expected, expectedFrom, got, gotFrom)

Source from the content-addressed store, hash-verified

122let issueCount = 0
123
124function maybeCheckExpectation (name, expected, expectedFrom, got, gotFrom) {
125 if (knownProblems.has(name)) {
126 try {
127 checkExpectation(expected, got)
128 } catch (err) {
129 issueCount++
130 if (debug) {
131 console.log(
132 `PLEASE RESOLVE: '${gotFrom}' was supposed to '${expectedFrom}'`)
133 console.log(' but', err.toString())
134 }
135 }
136 } else {
137 try {
138 checkExpectation(expected, got)
139 } catch (err) {
140 console.error(`DOC ERROR: '${gotFrom}' was supposed to '${expectedFrom}'`)
141 throw err
142 }
143 }
144}
145
146function checkExpectation (want, got) {
147 if (Array.isArray(want)) {

Callers 1

doc.test.jsFile · 0.85

Calls 4

checkExpectationFunction · 0.85
hasMethod · 0.65
logMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…