This repository has been archived by the owner on Feb 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
47 lines (41 loc) · 1.57 KB
/
test.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
<!DOCTYPE html>
<meta charset="utf-8">
<title>Test Suite</title>
<link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.17.2.css">
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src="https://code.jquery.com/qunit/qunit-2.17.2.js"></script>
<script src="./maze.js"></script>
<script>
QUnit.module('Rules', () => {
const rules = new WikipediaRules()
QUnit.module('accpetedBy', () => {
QUnit.test('to the left of the 10 is 9', (assert) => {
const field = ['', 'c10', '']
assert.deepEqual(rules.acceptedBy(field, 0), ['c9'])
})
QUnit.test('to the right of the 10 is jack', (assert) => {
const field = ['c10', '', '']
assert.deepEqual(rules.acceptedBy(field, 1), ['cj'])
})
QUnit.test('loop across the field backwards', (assert) => {
const field = ['c10', '', '']
assert.deepEqual(rules.acceptedBy(field, 2), ['c9'])
})
QUnit.test('loop across the field forward', (assert) => {
const field = ['', '', 'c10']
assert.deepEqual(rules.acceptedBy(field, 0), ['cj'])
})
QUnit.test('to the right of queen any ace', (assert) => {
const field = ['', 'hq', '']
assert.deepEqual(rules.acceptedBy(field, 2), ['h1', 'd1', 'c1', 's1'])
})
QUnit.test('to the left of ace is nothing', (assert) => {
const field = ['', 'h1', '']
assert.deepEqual(rules.acceptedBy(field, 0), [])
})
})
})
</script>
</body>