Skip to content

Conversation

@dynst
Copy link
Contributor

@dynst dynst commented Aug 15, 2025

Vitest has decent defaults so a configuration file may not even be required.

Blocked on:
#1809 & #1832 & #1833 #1004

Converting is easy now that xit is in use:

- `xit` = `it.skip` - `jasmine.stringMatching` = [`expect.stringMatching`](https://vitest.dev/api/expect.html#expect-stringmatching) - `expect(a).withContext(b)` = `expect(a, b)` - [`expectAsync(p).toBeRejectedWithError(/regex/)`](https://jasmine.github.io/api/4.6/async-matchers.html) = `expect(p).rejects.toThrowError(/regex/)`

And --quiet is passed by the coverage script, so that has to be removed when replacing the Jasmine CJS file.

displaySuccessful: !process.argv.includes("--quiet"),

"coverage": "nyc --reporter=text --reporter=lcov yarn test --quiet",

The default timeout in Vitest is 5s but some tests need longer than that. The slow server tests have a 5s server-side delay, so:

[@cosmjs/socket]:  ✓ src/streamingsocket.spec.ts (6 tests) 9446ms
[@cosmjs/socket]:    ✓ StreamingSocket > can connect to slow server  7408ms

socket tests that spawn child processes with exec() are heavily entangled with the others. If one test times out, it causes completely unrelated tests to fail. And they can't be run in parallel (Vitest has per-spec-file parallelism by default).

}, 2000);
}, 2000);
});
}, 1000);

@dynst dynst force-pushed the vitest-it branch 4 times, most recently from 886315e to 25f8e03 Compare August 18, 2025 03:21
@dynst dynst force-pushed the vitest-it branch 2 times, most recently from 4382591 to 9165c6b Compare October 8, 2025 22:03
@dynst dynst marked this pull request as draft October 8, 2025 22:15
@dynst
Copy link
Contributor Author

dynst commented Oct 8, 2025

Why is there a --stream argument that's always passed to all the tests? And why is it in the workflow config, instead of in the root-level package.json, or individual packages' scripts?

run: yarn test --stream

yarn test --stream

Is there another way to do whatever it is it's doing?

0d41983

Edit: #1850

@dynst dynst mentioned this pull request Oct 8, 2025
@dynst dynst force-pushed the vitest-it branch 13 times, most recently from c450087 to 8c5bf0a Compare October 15, 2025 17:29
dynst added 6 commits October 26, 2025 22:09
This advertises the minimum node version in the shields.io badge.
In a local test it took 9.8s to complete.
Even given the comment, 1s might be excessively large.
"process them later" test and "broken off" test
dynst added 4 commits October 26, 2025 22:09
It took about 7.5s in testing. It seems slower in Vitest
than Jasmine oddly, the server side delay is only 5s.
and use the same filename as all other packages use, testutils
with an S for consistency.
And here's no testdata/ directory in this package,
only in cosmwasm-stargate, so delete that glob.
@dynst dynst force-pushed the vitest-it branch 2 times, most recently from 189d01f to a55d9a3 Compare October 26, 2025 22:17
@dynst dynst force-pushed the vitest-it branch 2 times, most recently from e955ff2 to 5a8c47a Compare October 26, 2025 23:07
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.

1 participant