Skip to content

Testing

javarome edited this page May 21, 2024 · 2 revisions

ssg-api is a provided as a native ESM package, so:

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 ;)

Clone this wiki locally