Add example site

This commit is contained in:
Joseph Kato
2020-01-22 22:03:16 -08:00
parent e5a08ce1a8
commit 552a970ef5
17 changed files with 1178 additions and 0 deletions

23
code/js/test.js Normal file
View File

@@ -0,0 +1,23 @@
/* Testing Node.js with Markdata
Usage: ./node_modules/mocha/bin/mocha */
var assert = require('assert');
describe('Array', function() {
describe('#indexOf()', function() {
it('should report the correct index', function() {
var array = [2, 9, 9];
array.indexOf(2); // 0
array.indexOf(7); // -1
array.indexOf(9, 2); // 2
array.indexOf(2, -1); // -1
array.indexOf(2, -3); // 0
assert.equal(array.indexOf(2), 0);
assert.equal(array.indexOf(7), -1);
assert.equal(array.indexOf(9, 2), 2);
assert.equal(array.indexOf(2, -1), -1);
assert.equal(array.indexOf(2, -3), 0);
});
});
});