Skip to content

Commit ade1344

Browse files
committed
Improve VectorTests page and import path
Add HTML metadata and user instructions (lang, charset, heading, and note to open the dev console) and remove the #test-results div for a clearer test page. In sketch.js add a doc comment describing the Vector unit tests and update the makelab.math import to a relative path ('../../../../dist/makelab.math.js') to match project layout.
1 parent d5790ed commit ade1344

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33
<head>
4+
<meta charset="UTF-8">
45
<title>Vector Test Results</title>
56
</head>
67
<body>
7-
<div id="test-results"></div>
8+
<h1>Vector Tests</h1>
9+
<p>Open the browser dev console to see test results
10+
(<kbd>Ctrl+Shift+I</kbd> on Windows, <kbd>Cmd+Option+I</kbd> on Mac).</p>
811
<script type="module" src="sketch.js"></script>
912
</body>
1013
</html>

src/apps/math/VectorTests/sketch.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
// vector-tests.js
2-
import { Vector } from '/dist/makelab.math.js';
1+
/**
2+
* Vector class unit tests.
3+
*
4+
* Runs basic arithmetic, magnitude, normalization, dot product, and angle
5+
* tests against the Vector class from makelab.math. Results are logged to
6+
* the browser dev console (Cmd+Option+I on Mac, Ctrl+Shift+I on Windows).
7+
*/
8+
import { Vector } from '../../../../dist/makelab.math.js';
39

410
function testVector(testName, expectedResult, actualResult) {
511
const result = expectedResult === actualResult;

0 commit comments

Comments
 (0)