Skip to content

CHORE: Convert tests to Node.js built-in test runner, remove Jest#86

Merged
lowlydba merged 8 commits into
mainfrom
copilot/convert-tests-to-node-test-runner
May 4, 2026
Merged

CHORE: Convert tests to Node.js built-in test runner, remove Jest#86
lowlydba merged 8 commits into
mainfrom
copilot/convert-tests-to-node-test-runner

Conversation

Copilot AI commented May 4, 2026

Copy link
Copy Markdown
Contributor
  • Fix ERR_MODULE_NOT_FOUND — change core.js import to core.ts
  • Fix mock.module is not a function — refactor run() to accept an injectable coreApi parameter, removing the need for mock.module() and experimental VM flags
  • Add are-we-good rollup job to CI workflow aggregating all test job statuses

Copilot AI linked an issue May 4, 2026 that may be closed by this pull request
@lowlydba lowlydba marked this pull request as ready for review May 4, 2026 19:47
Copilot AI review requested due to automatic review settings May 4, 2026 19:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

Copilot AI requested a review from lowlydba as a code owner May 4, 2026 19:57
@lowlydba

lowlydba commented May 4, 2026

Copy link
Copy Markdown
Owner

@copilot resolve the merge conflicts in this pull request

@lowlydba lowlydba enabled auto-merge (squash) May 4, 2026 19:58
Copilot AI changed the title [WIP] Convert all tests to use builtin Node test runner and remove Jest Convert tests to Node.js built-in test runner, remove Jest May 4, 2026
…-to-node-test-runner

# Conflicts:
#	package-lock.json
#	package.json

Co-authored-by: lowlydba <16843041+lowlydba@users.noreply.github.com>
auto-merge was automatically disabled May 4, 2026 20:02

Head branch was pushed to by a user without write access

Copilot AI requested review from Copilot and removed request for Copilot May 4, 2026 20:02

Copilot AI commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Resolved in 6e89507. The conflicts were in package.json (TypeScript version: kept ^6.0.3 from main, dropped ts-jest/ts-jest-resolver) and tsconfig.eslint.json/tsconfig.json (auto-merged the new rootDir fields added in main). package-lock.json was regenerated after resolving the dependency conflict.

@lowlydba lowlydba changed the title Convert tests to Node.js built-in test runner, remove Jest CHORE: Convert tests to Node.js built-in test runner, remove Jest May 4, 2026
Copilot AI requested review from Copilot and removed request for Copilot May 4, 2026 20:06
Copilot AI requested a review from lowlydba May 4, 2026 20:06
@lowlydba

lowlydba commented May 4, 2026

Copy link
Copy Markdown
Owner

@copilot fix the CI test errors, ensure all tests work before completing.

After all tests are working, add new rollup job for all test status using lowlydba/are-we-good

Copilot AI requested review from Copilot and removed request for Copilot May 4, 2026 20:10

Copilot AI commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix the CI test errors, ensure all tests work before completing.

...

The CI test error was fixed in 1c1dc51 (changed core.jscore.ts in the test import, required by --experimental-strip-types).

Added the all-good rollup job in 98f53f7 — it depends on all three test jobs (test-typescript, test-action, test-action-without-secrets), runs with if: always(), and uses lowlydba/are-we-good@v1.0.3 to aggregate their statuses into a single pass/fail check. Since test-action and test-action-without-secrets are mutually exclusive, skipped jobs are accepted by default.

Copilot AI requested review from Copilot and removed request for Copilot May 4, 2026 20:21
Copilot AI requested review from Copilot and removed request for Copilot May 4, 2026 20:24
@lowlydba

lowlydba commented May 4, 2026

Copy link
Copy Markdown
Owner

@copilot Fix the failing test cases:

▶ main.ts
✔ Sends alert successfully with all inputs (2.574229ms)
✔ Sends alert with minimal inputs (0.855542ms)
✖ Uses default alert source config ID when not provided (1.351545ms)
✖ Includes GitHub workflow context in metadata (1.656832ms)
✖ Uses default deduplication key if not provided (0.879386ms)
✖ Uses default source URL if not provided (0.587523ms)
✔ Handles invalid status (0.335154ms)
✔ Handles invalid metadata JSON (0.356343ms)
✔ Handles API error responses (0.442724ms)
✖ Handles resolved status (0.579839ms)
✖ main.ts (11.1379ms)
ℹ tests 10
ℹ suites 1
ℹ pass 5
ℹ fail 5
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 216.336039

✖ failing tests:

test at tests/main.test.ts:128:3
✖ Uses default alert source config ID when not provided (1.351545ms)
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

3 !== 1

  at TestContext.<anonymous> (file:///home/runner/work/incident-io-action/incident-io-action/__tests__/main.test.ts:144:12)
  at async Test.run (node:internal/test_runner/test:1069:7)
  at async Suite.processPendingSubtests (node:internal/test_runner/test:752:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: 3,
expected: 1,
operator: 'strictEqual'

}

test at tests/main.test.ts:149:3
✖ Includes GitHub workflow context in metadata (1.656832ms)
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

4 !== 1

  at TestContext.<anonymous> (file:///home/runner/work/incident-io-action/incident-io-action/__tests__/main.test.ts:153:12)
  at async Test.run (node:internal/test_runner/test:1069:7)
  at async Suite.processPendingSubtests (node:internal/test_runner/test:752:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: 4,
expected: 1,
operator: 'strictEqual'

}

test at tests/main.test.ts:174:3
✖ Uses default deduplication key if not provided (0.879386ms)
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

5 !== 1

  at TestContext.<anonymous> (file:///home/runner/work/incident-io-action/incident-io-action/__tests__/main.test.ts:184:12)
  at async Test.run (node:internal/test_runner/test:1069:7)
  at async Suite.processPendingSubtests (node:internal/test_runner/test:752:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: 5,
expected: 1,
operator: 'strictEqual'

}

test at tests/main.test.ts:194:3
✖ Uses default source URL if not provided (0.587523ms)
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

6 !== 1

  at TestContext.<anonymous> (file:///home/runner/work/incident-io-action/incident-io-action/__tests__/main.test.ts:204:12)
  at async Test.run (node:internal/test_runner/test:1069:7)
  at async Suite.processPendingSubtests (node:internal/test_runner/test:752:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: 6,
expected: 1,
operator: 'strictEqual'

}

test at tests/main.test.ts:271:3
✖ Handles resolved status (0.579839ms)
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

8 !== 1

  at TestContext.<anonymous> (file:///home/runner/work/incident-io-action/incident-io-action/__tests__/main.test.ts:280:12)
  at async Test.run (node:internal/test_runner/test:1069:7)
  at async Suite.processPendingSubtests (node:internal/test_runner/test:752:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: 8,
expected: 1,
operator: 'strictEqual'

}

Copilot AI requested review from Copilot and removed request for Copilot May 4, 2026 20:32
@lowlydba lowlydba enabled auto-merge (squash) May 4, 2026 20:39
@lowlydba lowlydba disabled auto-merge May 4, 2026 20:39
@lowlydba lowlydba merged commit 7f7271b into main May 4, 2026
23 checks passed
@lowlydba lowlydba deleted the copilot/convert-tests-to-node-test-runner branch May 4, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert all tests to use builtin Node Test Runner, deprecate use of Jest

3 participants