Skip to content

Conversation

@rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Dec 1, 2025

We are now running every test file through ts-jest, which means all TypeScript
code gets parsed again and again for every test.

Instead, in this PR we run our tests in 2 different ways:

  • In a dev environment, as TypeScript for quick iteration
  • In a CI environment, as JavaScript for higher throughput execution

Needs some related changes to the tests to make it all work out properly:

  • We need to update the snapshot resolver to always name the snapshots *.ts.snap (not sometimes *.ts.snap and sometimes *.js.snap)
  • We need to explicitly set up babel-jest so that mock hoisting still works.
  • We must use the jest.mock() implicit global in order for mock hoisting to work with babel-jest, so can't have explicit imports.
  • cx-api was not compiling its tests so we couldn't run .js tests.
  • Had to remove a stray custom resource test, as it was not being run and was in a broken state that took too much effort to fix.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@rix0rrr rix0rrr force-pushed the huijbers/run-tests-as-js branch from b2f490b to 7d6f3e6 Compare December 5, 2025 11:06
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

TestsPassed ❌️SkippedFailed
Security Guardian Results0 ran0 passed0 skipped0 failed
TestResult
No test annotations available

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

TestsPassed ❌️SkippedFailed
Security Guardian Results with resolved templates0 ran0 passed0 skipped0 failed
TestResult
No test annotations available

@rix0rrr rix0rrr force-pushed the huijbers/run-tests-as-js branch from 93f5b64 to afc1ac3 Compare December 5, 2025 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution/core This is a PR that came from AWS. p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant