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

Function runExamplesInDocs

test/unit-tests/expression/function/help.test.js:23–36  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

21}))
22
23function runExamplesInDocs (name) {
24 mathDocs.config(originalConfig)
25 // every function should have doc.examples
26 const examples = mathDocs.evaluate(`help("${name}")`).doc.examples
27 try {
28 // validate if the examples run without errors
29 mathDocs.evaluate(examples)
30 return
31 } catch {
32 }
33 // if they still have errors try with a new math instance
34 mathDocs = math.create(math.all)
35 mathDocs.evaluate(examples)
36}
37
38function hasValidSeeAlso (name) {
39 let seeAlso = []

Callers 1

help.test.jsFile · 0.85

Calls 2

createMethod · 0.80
evaluateMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…