FormidableLabs / FormidableLabs/victory

Tests: Add Node.js / SSR tests.

Open
#1,965 0 comments 0 reactions 0 assignees View on GitHub
Issue: Accepted Note: Testing :green_circle:
Dominant language
TypeScript
Stars
11.2k
Forks
536
PR merge metrics
No merged PRs in 30d

Description

### The Problem

We test our code in browsers via Karma, but we don't test in Node.js for SSR, which many of our users rely on. This means that for errors like our latest [Node.js + new ESM bug](https://github.com/FormidableLabs/victory/issues/1957) we didn't catch up because it only manifests in Node.js.

### Suggested Work

- [ ] Implement simple Node.js SSR tests in Node.js
- [ ] Pick a testing library that makes sense.
- [ ] Probably use `lib` CommonJS transpiled code (we could use `es` for a future Node + ESM test scenario, but for starters maybe just Node + good ol' CJS)
- [ ] Ideally _don't_ transpile our test code. That would mean using something like [htm](https://github.com/developit/htm) instead of JSX. Or Vanilla JS.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.