'node' | 'jsdom'
'node'
The environment that will be used for testing.
The default environment in Rstest is a Node.js
environment. If you are building a web application, you can use a browser-like environment through jsdom
instead.
Rstest supports jsdom for mocking DOM and browser APIs.
If you want to enable DOM testing, you can use the following configuration:
You also need to install jsdom
:
After enabling DOM testing, you can write tests that use browser APIs like document
and window
.