Skip to content

Commit

Permalink
feature/prettier-update:
Browse files Browse the repository at this point in the history
1. prettierrc
2. applying the new rules
  • Loading branch information
JasonShin committed Jul 7, 2018
1 parent e17bbf3 commit d768b77
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 120,
"singleQuote": true,
"bracketSpacing": true,
"parser": "typescript"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"build": "run-s clean && run-p build:*",
"build:main": "tsc -p tsconfig.json",
"build:module": "tsc -p tsconfig.module.json",
"fix": "npx prettier \"src/**/*.ts\" \"test/**/*.ts\" \"docs/**/*.ts\" --print-width 120 --write",
"fix": "npx prettier \"src/**/*.ts\" \"test/**/*.ts\" \"docs/**/*.ts\" --config ./.prettierrc --write",
"test": "npx run-s build test:*",
"test:lint": "npx tslint --force -t verbose 'test/**/*.ts' 'src/**/*.ts'",
"test:unit": "npx jest",
Expand Down
6 changes: 3 additions & 3 deletions test/clusters/k_means.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ describe('clusters:k_means', () => {
});

it('should predict [ 0, 0 ] from predVector2 prediction', () => {
const expectedResult = [ 0, 0 ];
const expectedResult = [0, 0];
const kmean = new KMeans({ k: 3 });
kmean.fit({ X: vector1 });
const pred = kmean.predict({ X: predVector2 });
expect(_.isEqual(pred, expectedResult)).toBe(true);
});

it('should predict [ 0, 0 ] from predVector2 with X: vector1', () => {
const expectedResult = [ 0, 0 ];
const expectedResult = [0, 0];
const kmean = new KMeans({ k: 2 });
kmean.fit({ X: vector1 });
const pred = kmean.predict({ X: predVector2 });
expect(_.isEqual(expectedResult, pred)).toBe(true);
})
});
});

0 comments on commit d768b77

Please sign in to comment.