Problem
Hey, while adding tests for a new Plivo operation, I noticed that plugin tests can't currently be run.
marketplace/package.json includes ts-jest, but there's no jest.config.* at the marketplace/ root (or inside individual plugins). As a result, Jest falls back to its default Babel transform and fails on TypeScript syntax instead of running the tests.
cd marketplace
npx jest plugins/plivo
This results in a Babel parse error (SyntaxError: Unexpected token...).
Also, each plugin's package.json has:
"test": "echo \"Error: run tests from root\" && exit 1"
but there doesn't seem to be a working root-level test setup either, so plugin tests can't currently be run.
Suggested fix
Add a jest.config.cjs at the marketplace/ root (similar to the newer plugin system):
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
rootDir: '.',
};
Since marketplace/package.json uses "type": "module", the config needs to be .cjs.
Context
Found this while adding tests for a new Plivo operation (PR #17020).
Problem
Hey, while adding tests for a new Plivo operation, I noticed that plugin tests can't currently be run.
marketplace/package.jsonincludests-jest, but there's nojest.config.*at themarketplace/root (or inside individual plugins). As a result, Jest falls back to its default Babel transform and fails on TypeScript syntax instead of running the tests.cd marketplace npx jest plugins/plivoThis results in a Babel parse error (
SyntaxError: Unexpected token...).Also, each plugin's
package.jsonhas:but there doesn't seem to be a working root-level test setup either, so plugin tests can't currently be run.
Suggested fix
Add a
jest.config.cjsat themarketplace/root (similar to the newer plugin system):Since
marketplace/package.jsonuses"type": "module", the config needs to be.cjs.Context
Found this while adding tests for a new Plivo operation (PR #17020).