Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Soontao committed May 21, 2022
1 parent d442c5a commit 420160a
Show file tree
Hide file tree
Showing 9 changed files with 258 additions and 287 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/nodejs-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ jobs:

- name: npm ci
run: npm ci
env:
CI: true

- name: test & coverage
run: npm run coverage
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/nodejs-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ jobs:

- name: npm ci
run: npm ci
env:
CI: true

- run: npm run lint

4 changes: 2 additions & 2 deletions .github/workflows/nodejs-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
node-version: 18.x
registry-url: https://registry.npmjs.org/

- name: npm install
run: npm install
- name: npm ci
run: npm ci

- name: npm test
run: npm test
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ jobs:

- name: npm ci
run: npm ci
env:
CI: true

- run: npm run build --if-present

Expand Down
473 changes: 250 additions & 223 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
"devDependencies": {
"@commitlint/config-conventional": "^16.2.4",
"@types/jest": "^27.5.1",
"@types/node": "^16.11.35",
"@typescript-eslint/eslint-plugin": "^5.23.0",
"@typescript-eslint/parser": "^5.23.0",
"@types/node": "^16.11.36",
"@typescript-eslint/eslint-plugin": "^5.25.0",
"@typescript-eslint/parser": "^5.25.0",
"commitlint": "^16.3.0",
"eslint": "^8.15.0",
"eslint": "^8.16.0",
"eslint-plugin-jest": "^26.2.2",
"husky": "~4.3.8",
"jest": "^27.5.1",
"jest-junit": "^13.2.0",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.4",
"ts-jest": "^27.1.5",
"ts-node": "^10.7.0",
"typescript": "^4.6.4"
},
Expand Down
3 changes: 1 addition & 2 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

import * as assert from "./assert";
import * as object from "./object";
import * as perf from "./perf";

export const utils = {
assert, object, perf
assert, object,
};

export default utils;
23 changes: 0 additions & 23 deletions src/utils/perf.ts

This file was deleted.

26 changes: 0 additions & 26 deletions test/utilts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,5 @@ describe("Utils Test Suite", () => {
expect(utils.assert.mustBeArray([{ a: 1 }, { b: 1 }])).toStrictEqual([{ a: 1 }, { b: 1 }]);

});
it('should support method "memorized"', () => {

const k1 = {};
const k2 = "k2";
const f1 = jest.fn().mockReturnValue(1);
const f2 = jest.fn().mockReturnValue(2);

const mf1 = utils.perf.memorized(f1);
const mf2 = utils.perf.memorized(f2);

expect(mf1(k1)).toBe(1);
expect(mf1(k1)).toBe(1);
expect(mf1(k1)).toBe(1);
expect(mf1(k1)).toBe(1);
expect(f1).toBeCalledTimes(1);

expect(mf2(k2)).toBe(2);
expect(mf2(k2)).toBe(2);
expect(mf2(k2)).toBe(2);
expect(mf2(k2)).toBe(2);
expect(f2).toBeCalledTimes(1);

expect(() => mf1(k2)).toThrow();


});

});

0 comments on commit 420160a

Please sign in to comment.