##// END OF EJS Templates
Parse Date with moment.js or Because Date(str) return Now()...
Parse Date with moment.js or Because Date(str) return Now() Also so relative date in confirmation dialog because It's easier to parse mentally. Closes #7535

File last commit:

r19867:e9b0944e
r20211:83781895
Show More
highlight.js
57 lines | 2.0 KiB | application/javascript | JavascriptLexer
Nicholas Bollweg (Nick)
using codemirror mode/meta for detection
r19286 casper.notebook_test(function () {
this.on('remote.callback', function(data){
if(data.error_expected){
that.test.assertEquals(
data.error,
Min RK
fix highlight test for failed highlighting...
r19867 true,
"!highlight: " + data.provided + " errors"
Nicholas Bollweg (Nick)
using codemirror mode/meta for detection
r19286 );
}else{
that.test.assertEquals(
data.observed,
data.expected,
"highlight: " + data.provided + " as " + data.expected
);
}
});
var that = this;
// syntax highlighting
[
{to: "gfm"},
{to: "python"},
{to: "ipython"},
{to: "ipythongfm"},
{to: "text/x-markdown", from: [".md"]},
{to: "text/x-python", from: [".py", "Python"]},
{to: "application/json", from: ["json", "JSON"]},
{to: "text/x-ruby", from: [".rb", "ruby", "Ruby"]},
{to: "application/ld+json", from: ["json-ld", "JSON-LD"]},
{from: [".pyc"], error: true},
{from: ["../"], error: true},
{from: ["//"], error: true},
].map(function (mode) {
Nicholas Bollweg (Nick)
fixing tests
r19288 (mode.from || []).concat(mode.to || []).map(function(from){
Nicholas Bollweg (Nick)
using codemirror mode/meta for detection
r19286 casper.evaluate(function(from, expected, error_expected){
IPython.utils.requireCodeMirrorMode(from, function(observed){
window.callPhantom({
provided: from,
expected: expected,
observed: observed,
error_expected: error_expected
});
}, function(error){
window.callPhantom({
provided: from,
expected: expected,
Min RK
fix highlight test for failed highlighting...
r19867 error: true,
Nicholas Bollweg (Nick)
using codemirror mode/meta for detection
r19286 error_expected: error_expected
Min RK
fix highlight test for failed highlighting...
r19867 });
Nicholas Bollweg (Nick)
using codemirror mode/meta for detection
r19286 });
}, {
from: from,
expected: mode.to,
error_expected: mode.error
});
});
});
});