-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
171 lines (161 loc) · 6.05 KB
/
Copy pathindex.html
File metadata and controls
171 lines (161 loc) · 6.05 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<script type="text/template" id="source-code"> // Edit Code to see instant Results
MyLib = function(){
this.say = "";
this.hello = function(name){
this.say = "Hello " + name;
}
this.goodbye = function(name){
this.say = "Goodbye " + name;
}
}
</script>
<script type="text/template" id="test-code"> // Edit Test to see instant Results
StepTest
.test("MyLib#hello")
.step("My Lib Setup")
.step("Say Hello", function(){
this.myLib.hello("Carson");
})
.expect("myLib's say Variable should be 'Hello Carson'", function(){
this.ok(this.myLib.say == "Hello Carson");
});
StepTest
.test("MyLib#goodbye")
.step("My Lib Setup")
.step("Say Goodbye", function(){
this.myLib.goodbye("Carson");
})
.expect("myLib's say Variable should be 'Goodbye Carson'", function(){
this.ok(this.myLib.say == "Goodbye Carson");
});
</script>
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800" rel="stylesheet" />
<script src="https://cdn.rawgit.com/step-test/step-test/7ba19a9a21abdcf43ae0a28827f0e51211210bc2/build/step-test.js"></script>
<script src="/main.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.25.0/codemirror.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.25.0/codemirror.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.25.0/theme/ambiance.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.25.0/mode/javascript/javascript.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<link rel="stylesheet" href="/style.css">
</head>
<body>
<div class="header">
<div class="logo-slug">
<div class="logo">
<div class="icon">
<i class="fa fa-play" aria-hidden="true"></i>
</div>
<div class="name">
<h1>
Step<br />Test
</h1>
</div>
</div>
<div class="slugline">A tool for seeing errors as they happen, <br />rather than after.</div>
</div>
<div class="links">
<ul>
<li>
<a href="https://github.com/step-test/step-test">Fork on Github</a>
</li>
<li>
<a href="https://github.com/step-test/karma-step-test">Karma Test Runner</a>
</li>
<li>
<a href="https://github.com/step-test/step-test-explain">StepTest Explain (Tool)</a>
</li>
<li>
<a href="/embedded-tests">Embedded Tests</a>
</li>
</ul>
</div>
</div>
<div class="main">
<div class="block text-center">
<h2>
Why would you want to use Step Test?
</h2>
<ol class="reasons text-left">
<li>
A whole 5KB of minified Goodness.
</li>
<li>
Control of your suite when developing so you can see it play through.
<br />
<strong>Play</strong>, <strong>Pause</strong>, and <strong>Next</strong> allow you to control every step.
</li>
<li>
ES6 Ready with its object Oriented Class Structure.
</li>
<li>
Easy to add features to and build out for your needs.
</li>
<li>
Document through your tests.
</li>
</ol>
</div>
<div class="block">
<h2>Writing Your Code</h2>
<div>
<div id="code">
</div>
<div class="result">
<div id="example-1-results">
</div>
</div>
</div>
</div>
<div class="block">
<h2>Writing Your Tests</h2>
<div>
<span style="color: #202020"><strong>Note:</strong></span> Class Level Step Available
<br />
<span style="color: #401d0b">StepTest</span>.<span style="color: #8a666c">step</span><span style="color:#214000">(</span><span style="color:#465e62">"My Lib Setup"</span>, <span style="color: #565e22">function</span><span style="color:#214000">(){</span> <br />
<span style="color: #565e22">this</span>.<span style="color: #8a666c">myLib</span> <span style="color: #cf4800">=</span> <span style="color: #565e22">new</span> <span style="color: #401d0b">MyLib</span><span style="color:#214000">(); <span><br />
<span style="color:#214000">})</span>
<br />
<br />
<span style="color: #202020"><strong>Note:</strong></span> Try
<br />
.<span style="color: #8a666c">step</span><span style="color:#214000">(</span><span style="color: #565e22">"Say"</span>, <span style="color:#214000">{</span><span style="color: #8a666c">k:</span> <span style="color: #565e22">"hello"</span><span style="color:#214000">,</span> <span style="color: #8a666c">to:</span> <span style="color: #565e22">"Your Name"<span><span style="color:#214000">})</span>
<br />
<br />
<div id="test">
</div>
<div class="result">
<div id="example-2-results">
</div>
</div>
</div>
</div>
</div>
<script>
var codeValue = document.querySelector("#source-code").innerHTML;
codeElement = document.querySelector("#code");
testElement = document.querySelector("#test");
var code = CodeMirror(codeElement, {
value: codeValue,
lineNumbers: true,
theme: "ambiance"
});
code.on("change", function(){
TestExample1()
})
var testValue = document.querySelector("#test-code").innerHTML;
var test = CodeMirror(testElement, {
value: testValue,
lineNumbers: true,
theme: "ambiance"
});
test.on("change", function(){
TestExample2()
})
TestExample1();
TestExample2();
</script>
</body>
</html>