-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
74 lines (66 loc) · 2.75 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Live Test</title>
<link rel="stylesheet" href="index.css">
<link rel="icon" type="image/png" href="icon.png">
</head>
<body>
<div class="tests">
<div class="container">
<div id="topline">
<ul>
<li id="loadbutton">Load
<li id="savebutton">Save
<li id="saveasbutton">Save As
<li id="exportbutton">Export
<li id="helpbutton">Help
</ul>
</div>
<div id="beforewrapper">
<h1>Before Each Test</h1>
<!-- Single textarea for setup will go here -->
</div>
<div id="testwrapper">
<h1>Tests</h1>
<!-- Textareas for tests will go here -->
</div>
<div><span class="addtest">Add a new test</span></div>
</div>
</div>
<div class="program">
<div class="container">
<div id="editor"></div>
</div>
</div>
<div class="modal">
<div class="modal-content">
<h2>Live Unit Test Playground</h2>
<p>Begin by writing a test, using <a href="http://chaijs.com/" target="_blank">Chai</a> for assertions. You’ll see a red bar on the left of the test because it is (or should be) failing. Next, write some code to make the test pass and get a green bar. (NOTE: The red bar shows only for failing assertions and thrown exceptions.)</p>
<p>Tests and coverage are run live. Uncovered code is underlined.</p>
<p>Each test is independent. If you need some code to run before each test (e.g., data structure initialization), enter it in the “Before Each Test” box.</p>
<p>Use the keyboard to work fluidly:</p>
<table border=1 cellspacing=0 cellpadding=2>
<tr><td>Ctrl+Enter<td>Toggle between editor and tests
<tr><td>Shift+Enter<td>Add a new test, or, if the last test box is empty, jump to it
<tr><td>Shift+Delete<td>Delete the currently focused test (if any)
<tr><td>Tab and Shift+Tab<td>Navigate through tests
</table>
<p>If the first line of a test is a comment, it will be used in the exported test script as the test’s description.</p>
</div>
</div>
<div id="flash"><!-- Flash messages will go here --></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.5/ace.js"></script>
<script src="lodash.custom.min.js"></script>
<script>
var editor = ace.edit("editor");
var Range = ace.require('ace/range').Range;
editor.setTheme("ace/theme/eclipse");
editor.$blockScrolling = Infinity;
editor.getSession().setMode("ace/mode/javascript");
editor.getSession().setTabSize(2);
</script>
<script src="index.js"></script>
</body>
</html>