Skip to content

Commit

Permalink
Merge pull request #4 from arsh73552/main
Browse files Browse the repository at this point in the history
test
  • Loading branch information
arsh73552 authored Jul 10, 2023
2 parents a56281b + 41e1347 commit 47c909f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions __tests__/test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
test('1 + 1 = 2', () =>{
expect(1 + 1).toBe(2);
})
const KMeansMatrixConverter = require('../Backend/src/kMeans.js')

console.log(typeof(KMeansMatrixConverter.arrayToMatrix([1,2,3,4,5,6,7,8,9], 3, 3)));
console.log(typeof([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ]))
test("Accepts an Array of values and returns a matrix of values with the given dimensions.", () => {
expect(JSON.stringify(KMeansMatrixConverter.arrayToMatrix([1,2,3,4,5,6,7,8,9], 3, 3)))
.toBe(JSON.stringify([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ]));
});
test("Accepts an Array of values and returns a matrix of values with the given dimensions.", () => {
expect(JSON.stringify(KMeansMatrixConverter.arrayToMatrix([1,2,3], 3, 1)))
.toBe(JSON.stringify([ [1, 2, 3] ]));
});

0 comments on commit 47c909f

Please sign in to comment.