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 10 times, most recently from 25c4c54 to 3de3ebd Compare October 15, 2025 10:36
@dynst dynst force-pushed the vitest-it branch 2 times, most recently from 9b8ac60 to c450087 Compare October 15, 2025 17:23
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