Physikerwelt has uploaded a new change for review.
https://gerrit.wikimedia.org/r/268869
Change subject: WIP: mhchem error fix
......................................................................
WIP: mhchem error fix
Change-Id: I73802b2be2d10e8395c1751eb31930d634be00fa
---
M package.json
M test/features/math/simple.js
2 files changed, 15 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mathoid
refs/changes/69/268869/1
diff --git a/package.json b/package.json
index 3d2a5c1..806607c 100644
--- a/package.json
+++ b/package.json
@@ -47,7 +47,7 @@
"preq": "^0.4.8",
"service-runner": "^0.3.8",
"mathoid-mathjax-node": "^0.5.0",
- "texvcinfo": "^0.4.1"
+ "texvcinfo": "git+https://github.com/physikerwelt/texvcinfo#mhchem"
},
"devDependencies": {
"extend": "^3.0.0",
diff --git a/test/features/math/simple.js b/test/features/math/simple.js
index ea0cf31..47c269e 100644
--- a/test/features/math/simple.js
+++ b/test/features/math/simple.js
@@ -249,6 +249,20 @@
assert.deepEqual(res.body.detail.error.location.end.column,
12);
});
});
+ it("reject use of \\ce commands without chemistry mode enabled",
function () {
+ return preq.post({
+ uri: baseURL,
+ body: {q: "\\ce{H2O}"}
+ }).then(function (res) {
+ // if we are here, no error was thrown, not good
+ throw new Error('Expected an error to be thrown, got status: '
+ res.status);
+ }, function (res) {
+ assert.status(res, 400);
+ assert.deepEqual(res.body.success, false);
+ assert.deepEqual(res.body.detail.error.found, "\\ce");
+ assert.deepEqual(res.body.error, "SyntaxError: Attempting to
use the $\\ce$ command outside of a chemistry environment.");
+ });
+ });
it("reject invalid input type", function () {
return preq.post({
uri: baseURL,
--
To view, visit https://gerrit.wikimedia.org/r/268869
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I73802b2be2d10e8395c1751eb31930d634be00fa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mathoid
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits