Show More
@@ -1,58 +1,58 b'' | |||||
1 | casper.notebook_test(function () { |
|
1 | casper.notebook_test(function () { | |
2 | this.on('remote.callback', function(data){ |
|
2 | this.on('remote.callback', function(data){ | |
3 | if(data.error_expected){ |
|
3 | if(data.error_expected){ | |
4 | that.test.assertEquals( |
|
4 | that.test.assertEquals( | |
5 | data.error, |
|
5 | data.error, | |
6 |
|
|
6 | true, | |
7 |
"!highlight: " + data.provided + " errors |
|
7 | "!highlight: " + data.provided + " errors" | |
8 | ); |
|
8 | ); | |
9 | }else{ |
|
9 | }else{ | |
10 | that.test.assertEquals( |
|
10 | that.test.assertEquals( | |
11 | data.observed, |
|
11 | data.observed, | |
12 | data.expected, |
|
12 | data.expected, | |
13 | "highlight: " + data.provided + " as " + data.expected |
|
13 | "highlight: " + data.provided + " as " + data.expected | |
14 | ); |
|
14 | ); | |
15 | } |
|
15 | } | |
16 | }); |
|
16 | }); | |
17 |
|
17 | |||
18 | var that = this; |
|
18 | var that = this; | |
19 | // syntax highlighting |
|
19 | // syntax highlighting | |
20 | [ |
|
20 | [ | |
21 | {to: "gfm"}, |
|
21 | {to: "gfm"}, | |
22 | {to: "python"}, |
|
22 | {to: "python"}, | |
23 | {to: "ipython"}, |
|
23 | {to: "ipython"}, | |
24 | {to: "ipythongfm"}, |
|
24 | {to: "ipythongfm"}, | |
25 | {to: "text/x-markdown", from: [".md"]}, |
|
25 | {to: "text/x-markdown", from: [".md"]}, | |
26 | {to: "text/x-python", from: [".py", "Python"]}, |
|
26 | {to: "text/x-python", from: [".py", "Python"]}, | |
27 | {to: "application/json", from: ["json", "JSON"]}, |
|
27 | {to: "application/json", from: ["json", "JSON"]}, | |
28 | {to: "text/x-ruby", from: [".rb", "ruby", "Ruby"]}, |
|
28 | {to: "text/x-ruby", from: [".rb", "ruby", "Ruby"]}, | |
29 | {to: "application/ld+json", from: ["json-ld", "JSON-LD"]}, |
|
29 | {to: "application/ld+json", from: ["json-ld", "JSON-LD"]}, | |
30 | {from: [".pyc"], error: true}, |
|
30 | {from: [".pyc"], error: true}, | |
31 | {from: ["../"], error: true}, |
|
31 | {from: ["../"], error: true}, | |
32 | {from: ["//"], error: true}, |
|
32 | {from: ["//"], error: true}, | |
33 | ].map(function (mode) { |
|
33 | ].map(function (mode) { | |
34 | (mode.from || []).concat(mode.to || []).map(function(from){ |
|
34 | (mode.from || []).concat(mode.to || []).map(function(from){ | |
35 | casper.evaluate(function(from, expected, error_expected){ |
|
35 | casper.evaluate(function(from, expected, error_expected){ | |
36 | IPython.utils.requireCodeMirrorMode(from, function(observed){ |
|
36 | IPython.utils.requireCodeMirrorMode(from, function(observed){ | |
37 | window.callPhantom({ |
|
37 | window.callPhantom({ | |
38 | provided: from, |
|
38 | provided: from, | |
39 | expected: expected, |
|
39 | expected: expected, | |
40 | observed: observed, |
|
40 | observed: observed, | |
41 | error_expected: error_expected |
|
41 | error_expected: error_expected | |
42 | }); |
|
42 | }); | |
43 | }, function(error){ |
|
43 | }, function(error){ | |
44 | window.callPhantom({ |
|
44 | window.callPhantom({ | |
45 | provided: from, |
|
45 | provided: from, | |
46 | expected: expected, |
|
46 | expected: expected, | |
47 |
error: |
|
47 | error: true, | |
48 | error_expected: error_expected |
|
48 | error_expected: error_expected | |
49 |
}); |
|
49 | }); | |
50 | }); |
|
50 | }); | |
51 | }, { |
|
51 | }, { | |
52 | from: from, |
|
52 | from: from, | |
53 | expected: mode.to, |
|
53 | expected: mode.to, | |
54 | error_expected: mode.error |
|
54 | error_expected: mode.error | |
55 | }); |
|
55 | }); | |
56 | }); |
|
56 | }); | |
57 | }); |
|
57 | }); | |
58 | }); No newline at end of file |
|
58 | }); |
General Comments 0
You need to be logged in to leave comments.
Login now