Skip to content

Commit

Permalink
fix(point): test and doc for empty constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTelanie committed Sep 29, 2019
1 parent a1731e0 commit 2c78fd0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/point.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ const ipointFactory = cachedFactory(IPoint);
* @typedef {(alg: Alg) => IPointType} IPointAlg
* @typedef {(x: number , y: number) => IPointType} IPointCon
* @typedef {(data: [number, number]) => IPointType} IPointArr
* @typedef {IPointAlg & IPointCon & IPointArr & IPointType}
* @typedef {IPointAlg & IPointCon & IPointArr & IPointType & IPointZero}
*
* @param {number | [number, number] | Alg} [x]
* @param {number} [y]
Expand Down
6 changes: 6 additions & 0 deletions test/point.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ import {
* @param {(typeof Point) | (typeof IPoint)} Vec2
*/
const pointTest = (vec2, Vec2) => {
it('should create empty vector', () => {
const pos = vec2();
assert.equal(pos.x, 0);
assert.equal(pos.y, 0);
});

it('should create x y values', () => {
const pos = vec2(5, 6);
assert.equal(pos.x, 5);
Expand Down

0 comments on commit 2c78fd0

Please sign in to comment.