I'm encountering a really frustrating issue trying to use Vitest with the ArcGIS JS API. Currently I have to mock every view that utilises anything from calcite in order to get Vitest to work for me, otherwise it fails 100% of the time.
It looks like there is an issue with how Vitest interacts with the imports of Stencil JS. Has anyone encountered this? Its been an issue for at least 6 month or so.
SyntaxError: Named export 'getAssetPath' not found. The requested module '@stencil/core/internal/client/index.js' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from '@stencil/core/internal/client/index.js';
const { getAssetPath, setAssetPath, setNonce, setPlatformOptions } = pkg;