Skip to content

Commit 7e64818

Browse files
committed
[test] add test for fontURL configuration
1 parent 2c451bd commit 7e64818

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/base-config-fonturl.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
var tape = require('tape');
2+
var mjAPI = require("../lib/main.js");
3+
4+
tape('basic configuration: check fontURL', function (t) {
5+
t.plan(2);
6+
7+
var tex = 'a';
8+
mjAPI.typeset({
9+
math: tex,
10+
format: "TeX",
11+
css: true
12+
}, function (result, data) {
13+
t.ok(result.css.indexOf('https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/fonts/HTML-CSS') > -1, 'Default fontURL');
14+
});
15+
// reconfigure
16+
mjAPI.typeset({
17+
math: ''
18+
}, function(){
19+
mjAPI.config({
20+
fontURL: 'https://example.com'
21+
});
22+
mjAPI.start();
23+
})
24+
mjAPI.typeset({
25+
math: tex,
26+
format: "TeX",
27+
css: true,
28+
}, function (result, data) {
29+
t.ok(result.css.indexOf('https://example.com') > -1, 'Configuring fontURL');
30+
});
31+
});

0 commit comments

Comments
 (0)