-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
bragg/nbi/au.gov.ansto.bragg.nbi.webserver/WebContent/QUnit.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>Test Suite</title> | ||
<link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.21.0.css"> | ||
<body> | ||
<div id="qunit"></div> | ||
<div id="qunit-fixture"></div> | ||
<script type="text/javascript"> | ||
const _DEBUG_ENABLED = true; | ||
</script> | ||
<script src="js/jquery/jquery-1.10.2.min.js"></script> | ||
<script src="js/sedbConfig.js"></script> | ||
<script src="https://code.jquery.com/qunit/qunit-2.21.0.js"></script> | ||
<script src="js/QUnitCases.js"></script> | ||
</body> |
19 changes: 19 additions & 0 deletions
19
bragg/nbi/au.gov.ansto.bragg.nbi.webserver/WebContent/js/QUnitCases.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
function add(a, b) { | ||
return a + b; | ||
} | ||
|
||
QUnit.module('add', function() { | ||
QUnit.test('two numbers', function(assert) { | ||
const a = 2; | ||
assert.equal(add(1, a), 3); | ||
}); | ||
}); | ||
|
||
QUnit.module('SEDB', function() { | ||
QUnit.test('DBModel', function(assert) { | ||
assert.equal(add(1, 2), 3); | ||
const dbModel = new DBModel(); | ||
dbModel.load(); | ||
assert.ok(dbModel != null); | ||
}); | ||
}); |