test: add jest config, CI, and repair the suite - #3
Draft
janakiram7755 wants to merge 4 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #2. The repo had no jest config and no CI — both lived at the old monorepo root.
9/9 suites, 62/62 tests green.
Jest config follows upstream: ts-jest compiles to CommonJS for the test run while
tscbuildslib/as ESM. ESM namespaces are immutable sojest.spyOncannot patch them; this keeps all 80 existing spyOn calls working with no restructuring. SamemoduleNameMapper+transformIgnorePatternsapproach they use.Repaired tests, all of which were asserting upstream's old contract:
getCacheEntry(key, restoreKeys, paths, opts)— ours takes 4 args, not 3reserveCache(key, chunks, version)— ours is positional, not an options objectdownloadCache(provider, ...)— ours dispatches on provider; replaced the URL-based Azure/http-client tests with s3 / gcs-without-token / unknown-providerArtifactCacheEntry/ReserveCacheResponseno longer exist; fixtures now use the realCommonsGetCacheResponse/CommonsReserveCacheResponseisFeatureAvailablereadsWARPBUILD_RUNNER_VERIFICATION_TOKEN, not the cache URLgetCacheVersionexpectations were correct all along but omitted the 4th argument, which leftprocess.archin the hash and made them machine-dependentRef: actions/toolkit jest.config.js