Use jest-environment-obsidian for specific unit test files.
Create a jest.config.cjs
file with the following contents:
module.exports = {
preset: 'jest-environment-obsidian',
};
- Allows for multiple different test environments.
- Simple to set up.
- May have issues with future Jest versions.