startit/oppgaver/uke6/8ball/unit_testing.html

27 lines
594 B
HTML
Raw Normal View History

2024-09-16 10:41:14 +02:00
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<title>QUnit</title>
<link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.22.0.css">
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src="https://code.jquery.com/qunit/qunit-2.22.0.js"></script>
<script src="controller.js"></script>
<script>
QUnit.test('Answer', function (assert) {
// arrange
let AffirmativeAnswers = ['hello'];
// act
let returnedText = pickRandomAnswer();
// assert
assert.equal(returnedText, 'hello');
});
</script>
</body>
</html>