Skip to content

Testing WorkerThreads with ts-mocha. #68

@akirilyuk

Description

@akirilyuk

Hi, when trying to create a test that tests the behavior of WorkerThreads, it fails to start the application with this error message, failing to parse my workerScript.ts:

import { parentPort } from "worker_threads";
^^^^^^

SyntaxError: Cannot use import statement outside a module

The application itself can be started with and is working via node -r ts-node/register/transpile-only

Is there any option to test WorkerThreads behaviour via ts-mocha at all?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions