From a647e28f34bf20fa3ae39658fc44517114072089 Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 03:34:38 -0500 Subject: [PATCH 01/34] Update calculator.test.js --- app/core/calculator.test.js | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/app/core/calculator.test.js b/app/core/calculator.test.js index 7560167..6dbcf41 100644 --- a/app/core/calculator.test.js +++ b/app/core/calculator.test.js @@ -26,33 +26,3 @@ test('subtract function', () => { expect(subtract(1e+100, 1e+100)).toBe(0); // Large number subtraction }); -test('multiply function', () => { - expect(multiply(1, 2)).toBe(2); - expect(multiply(2, 0)).toBe(0); - expect(multiply(-2, 3)).toBe(-6); - expect(multiply(0.5, 2)).toBe(1); // Floating point multiplication - expect(multiply(1000, 1000)).toBe(1000000); // Large number multiplication -}); - -test('divide function', () => { - expect(divide(10, 2)).toBe(5); - expect(divide(1, 0)).toBe("Cannot divide by 0"); // Divide by zero case - expect(divide(-10, 2)).toBe(-5); - expect(divide(10, -2)).toBe(-5); - expect(divide(1000, 1000)).toBe(1); // Large number division - expect(divide(5, "a")).toThrow(); // Invalid division input -}); - -test('divide2 function', () => { - expect(divide(10, 2)).toBe(5); // Valid division - expect(divide(1, 0)).toBe("Cannot divide by 0"); // This tests the divide by zero scenario - expect(divide(-10, 2)).toBe(-5); // Negative division - expect(divide(10, -2)).toBe(-5); // Negative division with swapped operands -}); - - -test('floating-point operations', () => { - expect(add(0.1, 0.2)).toBeCloseTo(0.3, 5); // Floating point precision - expect(subtract(0.3, 0.1)).toBeCloseTo(0.2, 5); // Floating point subtraction - expect(multiply(0.1, 0.2)).toBeCloseTo(0.02, 5); // Floating point multiplication -}); From 8cb3afea22e5c3ebc171e808e760091e36c3b85a Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 03:38:33 -0500 Subject: [PATCH 02/34] Update ci.yml --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5044ada..0ac1455 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,8 +62,7 @@ jobs: - name: Upload code coverage to Codecov uses: codecov/codecov-action@v5 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} + - name: Upload test results to Codecov if: ${{ !cancelled() }} From 10ac3a27f380a66805c32ae0f919379456bee08e Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 03:41:05 -0500 Subject: [PATCH 03/34] Update ci.yml --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ac1455..5828a49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,6 +62,8 @@ jobs: - name: Upload code coverage to Codecov uses: codecov/codecov-action@v5 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Upload test results to Codecov From 6a1254f6b9d525ce6991fa3c0db7a3413574e02f Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 03:43:07 -0500 Subject: [PATCH 04/34] Update ci.yml --- .github/workflows/ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5828a49..b6afa54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,12 +66,6 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - name: Upload test results to Codecov - if: ${{ !cancelled() }} - uses: codecov/test-results-action@v1 - with: - token: ${{ secrets.CODECOV_ORG_TOKEN }} - - name: SonarQube Scan uses: SonarSource/sonarqube-scan-action@v5 env: From c5656f9e784e907813d1511baaf39b84f5443b55 Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 03:51:13 -0500 Subject: [PATCH 05/34] Update vite.config.js --- vite.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vite.config.js b/vite.config.js index 6d248dd..ed8084c 100644 --- a/vite.config.js +++ b/vite.config.js @@ -5,8 +5,8 @@ export default defineConfig({ include: ['app/**/*.test.js'], // Path to test files coverage: { provider: 'v8', // Using v8 coverage provider for modern JavaScript - reporters: ['lcov', 'text', 'json', 'html', 'cobertura'], // Output coverage formats - reportDir: 'coverage/lcov-report', // Directory for coverage reports + reporters: ['lcov', 'json', 'html'], // Output coverage formats + reportDir: 'coverage', // Directory for coverage reports }, } }); From bb0f2313efd107097a9038602ce242438a8ed0b0 Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 03:54:28 -0500 Subject: [PATCH 06/34] Update package.json --- package.json | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 3a7b637..e61f735 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,20 @@ - - - { + "name": "example-javascript", + "version": "1.0.0", "scripts": { - "test": "vitest run --coverage", + "test": "vitest run --coverage", // Ensure this runs the tests with coverage enabled "build": "vite build" }, "dependencies": { - "vitest": "1.6.1", - "@vitest/coverage-v8": "1.6.1", - "vite": "your-vite-version-here" + "vitest": "1.6.1", // Use the version that matches your requirements + "@vitest/coverage-v8": "1.6.1", // Coverage reporter for Vitest + "vite": "latest" // Ensure you are using a compatible version of Vite + }, + "devDependencies": { + // Any additional dev dependencies can go here if needed + }, + "jest": { + "collectCoverage": true, + "coverageReporters": ["lcov", "json", "html"] } } From 2e647618b4339554c1e16c93351ac5f5e0c7e483 Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 03:56:12 -0500 Subject: [PATCH 07/34] Update package.json --- package.json | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index e61f735..727ac2a 100644 --- a/package.json +++ b/package.json @@ -2,19 +2,13 @@ "name": "example-javascript", "version": "1.0.0", "scripts": { - "test": "vitest run --coverage", // Ensure this runs the tests with coverage enabled + "test": "vitest run --coverage", "build": "vite build" }, "dependencies": { - "vitest": "1.6.1", // Use the version that matches your requirements - "@vitest/coverage-v8": "1.6.1", // Coverage reporter for Vitest - "vite": "latest" // Ensure you are using a compatible version of Vite + "vitest": "1.6.1", + "@vitest/coverage-v8": "1.6.1", + "vite": "latest" }, - "devDependencies": { - // Any additional dev dependencies can go here if needed - }, - "jest": { - "collectCoverage": true, - "coverageReporters": ["lcov", "json", "html"] - } + "devDependencies": {} } From 8dc7af7f93cae0891d6be3e2af71a54febed6bca Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 03:59:46 -0500 Subject: [PATCH 08/34] Update vite.config.js --- vite.config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vite.config.js b/vite.config.js index ed8084c..266756e 100644 --- a/vite.config.js +++ b/vite.config.js @@ -6,7 +6,11 @@ export default defineConfig({ coverage: { provider: 'v8', // Using v8 coverage provider for modern JavaScript reporters: ['lcov', 'json', 'html'], // Output coverage formats - reportDir: 'coverage', // Directory for coverage reports + reportDir: 'coverage', + lcov: { + // Specify output path for LCOV file if necessary + outputDir: './coverage/lcov-reports' + } }, } }); From 12321e4d26cef3a9fc4721a2c15b30722014f8cb Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 04:00:01 -0500 Subject: [PATCH 09/34] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6afa54..9357b82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: node-version: 18 - name: Install dependencies - run: npm install + run: npm install vitest@latest @vitest/coverage-v8@latest - name: Verify Vitest installation From 2bec7da978a12545a598867dec12e96cfa87b7c6 Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 04:02:04 -0500 Subject: [PATCH 10/34] Update vite.config.js --- vite.config.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/vite.config.js b/vite.config.js index 266756e..0db14dd 100644 --- a/vite.config.js +++ b/vite.config.js @@ -5,12 +5,8 @@ export default defineConfig({ include: ['app/**/*.test.js'], // Path to test files coverage: { provider: 'v8', // Using v8 coverage provider for modern JavaScript - reporters: ['lcov', 'json', 'html'], // Output coverage formats + reporters: ['lcov'], // Output coverage formats reportDir: 'coverage', - lcov: { - // Specify output path for LCOV file if necessary - outputDir: './coverage/lcov-reports' - } }, } }); From 9f742267ebccb519b2b99b34f7c6cb74194f2b64 Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 04:07:44 -0500 Subject: [PATCH 11/34] Update package.json --- package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 727ac2a..0a5b39c 100644 --- a/package.json +++ b/package.json @@ -2,13 +2,13 @@ "name": "example-javascript", "version": "1.0.0", "scripts": { - "test": "vitest run --coverage", - "build": "vite build" + "test": "jest --coverage" }, - "dependencies": { - "vitest": "1.6.1", - "@vitest/coverage-v8": "1.6.1", - "vite": "latest" + "devDependencies": { + "jest": "^28.0.0", // Use the latest Jest version + "@jest/coverage": "^28.0.0" }, - "devDependencies": {} + "dependencies": { + "vite": "^2.9.0" + } } From eab59c63d0d139800535fb8b96b8bb893e3746cf Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 04:08:22 -0500 Subject: [PATCH 12/34] Update jest.config.js --- jest.config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jest.config.js b/jest.config.js index 137e9ef..88f5acd 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,6 +1,6 @@ module.exports = { - testEnvironment: 'jsdom', collectCoverage: true, // Enable coverage collection - coverageDirectory: 'coverage', // Set the output directory for coverage reports - coverageReporters: ['json', 'lcov', 'text', 'html'], // Specify formats for coverage reports + coverageReporters: ['lcov', 'json', 'html'], // Generate LCOV, JSON, and HTML reports + coverageDirectory: 'coverage', // Directory where the coverage reports will be saved + testEnvironment: 'node', // Or 'jsdom' depending on your needs }; From a09b462fc9cd1939e64d3ac41f04b8c55ec4462f Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 04:10:06 -0500 Subject: [PATCH 13/34] Update package.json --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0a5b39c..8a1c2aa 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,11 @@ "name": "example-javascript", "version": "1.0.0", "scripts": { - "test": "jest --coverage" + "test": "jest --coverage", + "build": "vite build" }, "devDependencies": { - "jest": "^28.0.0", // Use the latest Jest version + "jest": "^28.0.0", "@jest/coverage": "^28.0.0" }, "dependencies": { From cdb78be272993a92d7e18ee80264a70dcb9e27fc Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 04:11:04 -0500 Subject: [PATCH 14/34] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9357b82..b6afa54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: node-version: 18 - name: Install dependencies - run: npm install vitest@latest @vitest/coverage-v8@latest + run: npm install - name: Verify Vitest installation From 7c3188e65f6ef140a78c9e651e881b601d927550 Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 04:12:22 -0500 Subject: [PATCH 15/34] Update package.json --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 8a1c2aa..b4e5a26 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,7 @@ "build": "vite build" }, "devDependencies": { - "jest": "^28.0.0", - "@jest/coverage": "^28.0.0" + "jest": "^28.0.0" }, "dependencies": { "vite": "^2.9.0" From bddd63387f68ad12e905f999371dbe606844067e Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 04:14:26 -0500 Subject: [PATCH 16/34] Update ci.yml --- .github/workflows/ci.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6afa54..dc969dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,13 +21,6 @@ jobs: run: npm install - - name: Verify Vitest installation - run: | - echo "Checking Vitest installation..." - which vitest || echo "Vitest not found!" # Check if Vitest is installed - npm list vitest # List the Vitest package to verify installation - - # Uncomment this block if you eventually want bundle analysis enabled again: # # - name: Create vite.config.js (for Codecov Bundle Analysis) From 84cd05ec9b862b8345e08bb770745e9f64a90f48 Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 04:18:08 -0500 Subject: [PATCH 17/34] Update package.json --- package.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package.json b/package.json index b4e5a26..b40a682 100644 --- a/package.json +++ b/package.json @@ -10,5 +10,11 @@ }, "dependencies": { "vite": "^2.9.0" + }, + "jest": { + "collectCoverage": true, // Enable coverage collection + "coverageDirectory": "coverage", // Directory to store the coverage reports + "coverageReporters": ["lcov", "json", "text", "html"], // Report formats to generate + "coveragePathIgnorePatterns": ["/node_modules/", "/tests/"] // Optionally ignore directories } } From 9eb666d5956427c1b47f3b63eee8d29187bb317d Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 04:18:24 -0500 Subject: [PATCH 18/34] Update package.json --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b40a682..356fdbe 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,9 @@ "vite": "^2.9.0" }, "jest": { - "collectCoverage": true, // Enable coverage collection - "coverageDirectory": "coverage", // Directory to store the coverage reports - "coverageReporters": ["lcov", "json", "text", "html"], // Report formats to generate - "coveragePathIgnorePatterns": ["/node_modules/", "/tests/"] // Optionally ignore directories + "collectCoverage": true, + "coverageDirectory": "coverage", + "coverageReporters": ["lcov", "json", "text", "html"], + "coveragePathIgnorePatterns": ["/node_modules/", "/tests/"] } } From a3ddfbcb3dacac1c9a65f4385c6d22e99e2f100a Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 04:18:52 -0500 Subject: [PATCH 19/34] Update ci.yml --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc969dd..26a306b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,8 @@ jobs: node-version: 18 - name: Install dependencies - run: npm install + run: npm install jest --save-dev + # Uncomment this block if you eventually want bundle analysis enabled again: From cf59279ab13ab80e584af7ef1cbf3a57a8849b16 Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 04:20:55 -0500 Subject: [PATCH 20/34] Update package.json --- package.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/package.json b/package.json index 356fdbe..b4e5a26 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,5 @@ }, "dependencies": { "vite": "^2.9.0" - }, - "jest": { - "collectCoverage": true, - "coverageDirectory": "coverage", - "coverageReporters": ["lcov", "json", "text", "html"], - "coveragePathIgnorePatterns": ["/node_modules/", "/tests/"] } } From 1f4e619bbd5b2c5782d97966fae7507ab8dcca1c Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 04:23:14 -0500 Subject: [PATCH 21/34] Create babel.config.js --- babel.config.js | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 babel.config.js diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..a79d119 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + presets: ['@babel/preset-env'], +}; From d3f6c601c26608d6ee8c098360a7ebf0cd39e839 Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 04:23:36 -0500 Subject: [PATCH 22/34] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26a306b..9f29558 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: node-version: 18 - name: Install dependencies - run: npm install jest --save-dev + run: npm install --save-dev @babel/preset-env From bedbeb01652cb660d7b7807faeeb148e2bcf452e Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 14:00:13 -0500 Subject: [PATCH 23/34] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aaa07b0..dd9e8f3 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This example repository shows how Codecov can be integrated with a simple javascript project. It uses **GitHub Actions** and **CircleCI** as CI/CD providers and **jest** as the coverage provider. For more information, please see the links below. - + ## Links - [Quick Start](https://docs.codecov.com/docs/quick-start) - [GitHub Tutorial](https://docs.codecov.com/docs/github-tutorial) From f4795524c7ac6a3d42ac6a37ec1f4fe8e464828f Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 14:04:21 -0500 Subject: [PATCH 24/34] Update vite.config.js --- vite.config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vite.config.js b/vite.config.js index 0db14dd..352dd37 100644 --- a/vite.config.js +++ b/vite.config.js @@ -2,10 +2,10 @@ import { defineConfig } from 'vitest/config'; // Import Vitest config export default defineConfig({ test: { - include: ['app/**/*.test.js'], // Path to test files + include: ['app/**/*.test.js'], coverage: { - provider: 'v8', // Using v8 coverage provider for modern JavaScript - reporters: ['lcov'], // Output coverage formats + provider: 'v8', + reporters: ['lcov', 'json', 'html'], reportDir: 'coverage', }, } From 97f0c69f165ba1b7062ff41cc990e1b267c738cb Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 14:08:52 -0500 Subject: [PATCH 25/34] Update vite.config.js --- vite.config.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vite.config.js b/vite.config.js index 352dd37..6bc606d 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,12 +1,12 @@ -import { defineConfig } from 'vitest/config'; // Import Vitest config +import { defineConfig } from 'vitest/config'; export default defineConfig({ test: { include: ['app/**/*.test.js'], coverage: { - provider: 'v8', - reporters: ['lcov', 'json', 'html'], - reportDir: 'coverage', + provider: 'v8', + reporters: ['lcov', 'json', 'html'], + reportDir: 'coverage', }, } }); From 668ad99e0431d390f7f01397fbd942119583dffe Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 14:09:05 -0500 Subject: [PATCH 26/34] Update package.json --- package.json | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index b4e5a26..a80aa7d 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,9 @@ { - "name": "example-javascript", - "version": "1.0.0", "scripts": { - "test": "jest --coverage", - "build": "vite build" + "test": "vitest run" // Run Vitest tests }, "devDependencies": { - "jest": "^28.0.0" - }, - "dependencies": { - "vite": "^2.9.0" + "vitest": "^0.20.0", // Ensure Vitest is installed + "vite": "^2.9.0" // Vite for bundling (optional) } } From c79e426b7fc7dc03386e8b34cace995c5e20aad1 Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 14:09:44 -0500 Subject: [PATCH 27/34] Update package.json --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a80aa7d..9f884c7 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "scripts": { - "test": "vitest run" // Run Vitest tests + "test": "vitest run" }, "devDependencies": { - "vitest": "^0.20.0", // Ensure Vitest is installed - "vite": "^2.9.0" // Vite for bundling (optional) + "vitest": "^0.20.0", + "vite": "^2.9.0" } } From 15774affb0a588d094768b56f0632688af1bbb4c Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 14:09:56 -0500 Subject: [PATCH 28/34] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f29558..e0b1f01 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: node-version: 18 - name: Install dependencies - run: npm install --save-dev @babel/preset-env + run: nnpm install vitest --save-dev From 63b42a3f19053741a89e021b1d69f23878a3b86a Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 14:11:22 -0500 Subject: [PATCH 29/34] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0b1f01..c455129 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: node-version: 18 - name: Install dependencies - run: nnpm install vitest --save-dev + run: npm install vitest --save-dev From 9b737a278210689b87a898ed4b9c3e3e72bbf51c Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 14:16:40 -0500 Subject: [PATCH 30/34] Update ci.yml --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c455129..435d5be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,10 @@ jobs: # run: npm run build - name: Run tests with coverage - run: npm run test --coverage || true + run: | + mkdir -p coverage + npm run test -- --coverage || true + - name: List all files recursively (debugging step) run: | From 1339c7f478f7a2ba925f458c1e18678a205998b1 Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 14:20:02 -0500 Subject: [PATCH 31/34] Update ci.yml --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 435d5be..8369fa1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,8 +18,9 @@ jobs: node-version: 18 - name: Install dependencies - run: npm install vitest --save-dev - + run: | + npm install vitest --save-dev + npm install c8 --save-dev # Uncomment this block if you eventually want bundle analysis enabled again: From a785640747baa400909da44c04cef1d8b7273d33 Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 14:33:24 -0500 Subject: [PATCH 32/34] Update ci.yml --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8369fa1..4ed1ef5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,6 +57,9 @@ jobs: find . -type f -name "*.json" find . -type f -name "*.lcov*" + - name: Upload code coverage to codacy + run: bash <(curl -Ls https://coverage.codacy.com/get.sh) + - name: Upload code coverage to Codecov uses: codecov/codecov-action@v5 From d7718735364d033b1a9d5c0ba0a31438c7b28e9e Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 14:45:09 -0500 Subject: [PATCH 33/34] Update ci.yml --- .github/workflows/ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ed1ef5..f125b7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,8 +57,14 @@ jobs: find . -type f -name "*.json" find . -type f -name "*.lcov*" - - name: Upload code coverage to codacy + - name: Upload code coverage to Codacy run: bash <(curl -Ls https://coverage.codacy.com/get.sh) + env: + CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} + CODACY_API_TOKEN: ${{ secrets.CODACY_API_TOKEN }} + CODACY_ORGANIZATION_PROVIDER: gh + CODACY_USERNAME: nofarb + CODACY_PROJECT_NAME: example-javascript - name: Upload code coverage to Codecov From 2b21da58f6c975e0fdaca4ac86cb1c2db5f7be82 Mon Sep 17 00:00:00 2001 From: nofarb Date: Fri, 13 Jun 2025 14:52:07 -0500 Subject: [PATCH 34/34] Create app.js --- app.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 app.js diff --git a/app.js b/app.js new file mode 100644 index 0000000..2f62be5 --- /dev/null +++ b/app.js @@ -0,0 +1,36 @@ +const Calculator = require('./calculator'); +const MathUtils = require('./mathUtils'); + +// Let's do some very convoluted math operations for no reason. + +const calc = new Calculator(); + +// We'll add 10 and 20, then check if the result is even or odd, and then square it, cube it, and find the factorial of the result. + +let sum = calc.add(10, 20); // Sum of 10 + 20 + +let isEven = MathUtils.isEven(sum); // Is the sum even? +let isOdd = MathUtils.isOdd(sum); // Is the sum odd? + +console.log(`Sum: ${sum}`); +console.log(`Is the sum even? ${isEven}`); +console.log(`Is the sum odd? ${isOdd}`); + +let squared = MathUtils.square(sum); // Square of the sum +let cubed = MathUtils.cube(sum); // Cube of the sum + +console.log(`Squared sum: ${squared}`); +console.log(`Cubed sum: ${cubed}`); + +let factorial = MathUtils.factorial(sum); // Factorial of the sum + +console.log(`Factorial of sum: ${factorial}`); + +// Now let's subtract the sum by 5, check if it's even, square it again, then divide by 3 +let result = calc.subtract(sum, 5); +let resultSquared = MathUtils.square(result); +let resultDivided = calc.divide(resultSquared, 3); + +console.log(`Subtract 5 from sum: ${result}`); +console.log(`Squared result: ${resultSquared}`); +console.log(`Result divided by 3: ${resultDivided}`);