ToolJet / ToolJet/ToolJet

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

Open Beginner friendly
#17,048 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
40.9k
Forks
5.4k
Avg merge
2d 18h
Merged PRs (30d)
202

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with marketplace/package.json and the plugins/plivo test path, then run cd marketplace && npx jest plugins/plivo to reproduce the Babel syntax error. Add the marketplace-level Jest setup described in the issue and verify that TypeScript plugin tests run successfully instead of failing during parsing.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs, typescript
Domain
testing, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.