Skip to content

Marketplace plugins: no Jest config at marketplace/ root; tests fail with syntax errors instead of running #17048

Description

@sxryadipta

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions