From c76a825928682efcb6cb1caea4699859db4b0631 Mon Sep 17 00:00:00 2001 From: June Rockwell Date: Tue, 9 Feb 2021 09:15:15 -0800 Subject: [PATCH 1/2] Testing GitHub Actions --- .github/workflows/node.js.yml | 4 +++- README.md | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 85a4194..807cff6 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -1,7 +1,7 @@ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Node.js CI +name: npm test on: push: @@ -16,6 +16,7 @@ jobs: strategy: matrix: + # node-version: [15.x] node-version: [10.x, 12.x, 14.x, 15.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ @@ -27,4 +28,5 @@ jobs: node-version: ${{ matrix.node-version }} #- run: npm ci #- run: npm run build --if-present + - run: npm install - run: npm test diff --git a/README.md b/README.md index cac1c76..36668ff 100644 --- a/README.md +++ b/README.md @@ -43,3 +43,5 @@ Stop the app in regular NodeJS fashion - Node's Readline Module: https://nodejs.org/api/readline.html - How to setup Jest: https://amenallah.com/node-js-typescript-jest-express-starter/ - Binary Coversions: https://www.build-electronic-circuits.com/binary-number-system/ + +testing update \ No newline at end of file From c63f386ebcd446bf90c24413d2da630e6fbff9c0 Mon Sep 17 00:00:00 2001 From: June Rockwell Date: Fri, 14 Jan 2022 08:12:45 -0600 Subject: [PATCH 2/2] Update index.test.ts --- src/conversions/__tests__/index.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/conversions/__tests__/index.test.ts b/src/conversions/__tests__/index.test.ts index 3a3e544..3c6aa7a 100644 --- a/src/conversions/__tests__/index.test.ts +++ b/src/conversions/__tests__/index.test.ts @@ -3,8 +3,10 @@ import { binaryToDecimal, decimalToBinary } from "../index"; describe("Conversion Functions", () => { it("converts binary string to the correct decimal result", () => { const binary = "1101100"; - - expect(binaryToDecimal(binary)).toBe("Decimal Result: 108"); + let _fn = jest.fn(binaryToDecimal); + // _fn(binary); + expect(_fn(binary)).toBe("Decimal Result: 108"); + expect(_fn).toHaveBeenCalled(); }); it("converts decimal input (of type string) to the correct binary result", () => { @@ -12,4 +14,5 @@ describe("Conversion Functions", () => { expect(decimalToBinary(decimal)).toBe("Binary Result: 1101100"); }); + });