Skip to content

Commit d073a20

Browse files
committed
fix(test): rename index tests to vetor
1 parent 674fdda commit d073a20

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

test/index.js renamed to test/vector.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { assert } from 'chai';
2-
import { Vector, Victor, calc } from '../src';
2+
import { Vector, Victor, calc } from '../src/vector';
33
import * as Examples from '../examples';
44

55
const vectorTest = (Vec3) => {
@@ -55,7 +55,15 @@ const vectorTest = (Vec3) => {
5555
const length = dir.length;
5656
assert(length > 0.99 && length < 1.01, `${dir} should have length 1, but is ${length}`);
5757
});
58+
/*
59+
it('should change length to 1 when normalize via arithmetic', () => {
60+
const pos = new Vec3(5, 6, 7);
61+
const dir = calc(() => pos / Math.abs(pos));
5862
63+
const length = dir.length;
64+
assert(length > 0.99 && length < 1.01, `${dir} should have length 1, but is ${length}`);
65+
});
66+
*/
5967
it('should calculate the cross product', () => {
6068
const dir1 = new Vec3(0, 1, 0);
6169
const dir2 = new Vec3(-1, 0, 1);
@@ -202,6 +210,7 @@ describe('calc test.', () => {
202210
});
203211
});
204212

213+
/*
205214
describe('performance test', () => {
206215
it('should be fast', () => {
207216
let time = new Date().getTime();
@@ -228,4 +237,5 @@ describe('performance test', () => {
228237
time = new Date().getTime() - time;
229238
console.log('perf test faster', `${Math.round(time) / 1000}s`);
230239
});
231-
});
240+
});
241+
*/

0 commit comments

Comments
 (0)