SCUBA-338: Fix the client spec and run the test suite in CI - #83
Open
dvasilas wants to merge 4 commits into
Open
SCUBA-338: Fix the client spec and run the test suite in CI#83dvasilas wants to merge 4 commits into
dvasilas wants to merge 4 commits into
Conversation
jest 30 dropped the toThrowError alias from both the typings and the expect runtime, so the spec failed to compile and no test ran.
On hosts where localhost resolves to both ::1 and 127.0.0.1, node tries both and reports the failure as an AggregateError with an empty message, so the substring match on ECONNREFUSED failed on the CI runners. The code property carries ECONNREFUSED in both cases. Also await the server close so the request cannot race the shutdown.
close() returns a promise. Leaving it unawaited let the hook finish while the shutdown was still in flight.
test.yaml ran lint and build only. tsconfig excludes tests, so the build never type-checked the spec and the breakage went unnoticed.
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.
yarn testhas been failing ondevelopment/1.1since the jest 29 to 30 bump (4357689):tests/client.spec.tsdid not compile, so no test executed.CI was green because
test.yamlonly ranyarn lintandyarn build, andtsconfig.jsonexcludestestsfrom the build.Changes
toThrowErrorwithtoThrow. jest 30 dropped thetoThrowErroralias from the typings and from theexpectruntime, so these assertions failed to compile.codeinstead of message. TheECONNREFUSEDtest asserted on a message substring. Wherelocalhostresolves to both::1and127.0.0.1— as it does on the GitHub runners — node tries both and reports the failure as anAggregateErrorwith an empty message, so the substring never matched.codeisECONNREFUSEDin both cases.mockServer.close().Run testsstep to.github/workflows/test.yaml.