Skip to content

Commit 006274d

Browse files
committed
fix: ignore some of the examples in doc.test.js (see #3519)
1 parent b3e67e5 commit 006274d

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

src/core/function/config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export function configFactory (config, emit) {
1717
*
1818
* Examples:
1919
*
20-
*
2120
* import { create, all } from 'mathjs'
2221
*
2322
* // create a mathjs instance

src/expression/parse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({
6666
* node1.compile().evaluate() // 5
6767
*
6868
* let scope = {a:3, b:4}
69-
* const node2 = math.parse('a * b') // 12
69+
* const node2 = math.parse('a * b')
7070
* node2.evaluate(scope) // 12
7171
* const code2 = node2.compile()
7272
* code2.evaluate(scope) // 12

src/type/string.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ export const createString = /* #__PURE__ */ factory(name, dependencies, ({ typed
1616
*
1717
* Examples:
1818
*
19-
* math.string(4.2) // returns string '4.2'
20-
* math.string(math.complex(3, 2) // returns string '3 + 2i'
19+
* math.string(4.2) // returns string '4.2'
20+
* math.string(math.complex(3, 2)) // returns string '3 + 2i'
2121
*
2222
* const u = math.unit(5, 'km')
23-
* math.string(u.to('m')) // returns string '5000 m'
23+
* math.string(u.to('m')) // returns string '5000 m'
2424
*
25-
* math.string([true, false]) // returns ['true', 'false']
25+
* math.string([true, false]) // returns ['true', 'false']
2626
*
2727
* See also:
2828
*

test/node-tests/doc.test.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ function extractValue (spec) {
8686
return value
8787
}
8888

89+
const ignoreFunctions = new Set([
90+
'config'
91+
])
92+
8993
const knownProblems = new Set([
9094
'setUnion', 'unequal', 'equal', 'deepEqual', 'compareNatural', 'randomInt',
9195
'random', 'pickRandom', 'kldivergence',
@@ -97,7 +101,10 @@ const knownProblems = new Set([
97101
'mod', 'floor', 'fix', 'expm1', 'exp',
98102
'ceil', 'cbrt', 'add', 'slu',
99103
'rationalize', 'qr', 'lusolve', 'lup', 'derivative',
100-
'symbolicEqual', 'schur', 'sylvester', 'freqz', 'round'
104+
'symbolicEqual', 'schur', 'sylvester', 'freqz', 'round',
105+
'import', 'typed',
106+
'unit', 'sparse', 'matrix', 'index', 'bignumber', 'fraction', 'complex',
107+
'parse'
101108
])
102109

103110
let issueCount = 0
@@ -371,6 +378,10 @@ describe('Testing examples from (jsdoc) comments', function () {
371378
for (const category in byCategory) {
372379
describe('category: ' + category, function () {
373380
for (const doc of byCategory[category]) {
381+
if (ignoreFunctions.has(doc.name)) {
382+
continue
383+
}
384+
374385
it('satisfies ' + doc.name, function () {
375386
if (debug) {
376387
console.log(` Testing ${doc.name} ...`) // can remove once no known failures; for now it clarifies "PLEASE RESOLVE"

0 commit comments

Comments
 (0)