-
Notifications
You must be signed in to change notification settings - Fork 0
Testing
javarome edited this page May 21, 2024
·
2 revisions
ssg-api
is a provided as a native ESM package, so:
- you may want to enable them in your node version, using the
--experimental-vm-modules
option; - it may not be supported by all test frameworks out of the box.
For instance, Jest will require some specifics in its jest.config.js
to transform the package code (here as ts-jest config):
/** @type {import("ts-jest/dist/types").InitialOptionsTsJest} */
export default {
preset: "ts-jest/presets/default-esm",
modulePaths: ["node_modules", "src", "."],
testEnvironment: "node",
modulePathIgnorePatterns: ["dist\/.*", "node_modules/(?!@googlemaps)/"]
}
or if you want to avoid test framework headaches, just use testscript ;)