Skip to content

Commit

Permalink
docs: minor tweak to examples
Browse files Browse the repository at this point in the history
Add a bit more detail.
  • Loading branch information
Krinkle committed Aug 6, 2024
1 parent aed781e commit 62cc6d9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
20 changes: 12 additions & 8 deletions docs/resources/example-fail.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,24 @@
<script src="https://code.jquery.com/qunit/qunit-3.0.0-alpha.2.js"></script>
<script>
QUnit.test('apple', function (assert) {
assert.equal('this is expected', 'this is expected', 'example');
assert.true(true);
assert.true(true, 'stem');
assert.true(true, 'skin');
});
QUnit.test('banana', function (assert) {
assert.true(true, 'foo');
assert.equal('this is actual', 'this is expected', 'bar');
var sentence = 'This is actual.';
assert.equal(sentence, 'This is expected.', 'example sentence');
assert.true(true, 'bar');
assert.true(true, 'baz');
assert.true(true, 'quux');
});
QUnit.test('citron', function (assert) {
assert.equal('this is expected', 'this is expected', 'example');
assert.true(true);
QUnit.test('sauerkraut', function (assert) {
assert.true(true, 'acid rock');
assert.true(true, 'kraut rock');
});
QUnit.test('dampfnudel', function (assert) {
assert.true(true, 'stream');
assert.true(true, 'bun');
});
</script>
</body>
</html>
<!-- This is the demo on the home page. -->
10 changes: 9 additions & 1 deletion docs/resources/game.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ QUnit.module('game', (hooks) => {
assert.false(board.find(bob));
});

QUnit.test('move', (assert) => {
QUnit.test('moveRight', (assert) => {
const alice = new game.Robot();
board.add(alice);

Expand All @@ -56,5 +56,13 @@ QUnit.module('game', (hooks) => {
board.moveRight(bob);
}, board.BoardObjectError, 'not on board');
});

QUnit.test('moveLeft', (assert) => {
const alice = new game.Robot();
board.add(alice);

board.moveLeft(alice);
assert.propContains(board.find(alice), { x: 2, y: 0 }, 'teleport to far end');
});
});
});

0 comments on commit 62cc6d9

Please sign in to comment.