mathjs
Version:
Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with dif
18 lines (13 loc) • 576 B
JavaScript
var assert = require('assert'),
math = require('../../../index');
describe('pickRandom', function () {
// Note: pickRandom is a convenience function generated by distribution
// it is tested in distribution.test.js
it('should have a function pickRandom', function () {
assert.equal(typeof math.pickRandom, 'function');
})
it('should LaTeX pickRandom', function () {
var expression = math.parse('pickRandom([1,2,3])');
assert.equal(expression.toTex(), '\\mathrm{pickRandom}\\left(\\begin{bmatrix}1\\\\2\\\\3\\\\\\end{bmatrix}\\right)');
});
});