Skip to content

TestCafe hangs when a TypeScript class is passed as a dependency to a ClientFunction #3955

@AndreyBelym

Description

@AndreyBelym

What is your Test Scenario?

Pass a class as a dependency to a client function in a TypeScript test. See the "Test Code" section.

What is the Current behavior?

TestCafe hangs.

What is the Expected behavior?

TestCafe executes the client function.

What is your web application and your TestCafe test code?

Your website URL (or attach your complete example):

Your complete test code (or attach your test files):
 import { ClientFunction } from 'testcafe';

class Foo {
    bar: number;
    
    constructor () {
        this.bar = 42;
    }
}

const exec = ClientFunction(() => new Foo(), { dependencies: { Foo }});

fixture `example`.page `example.com`;


test(`example`, async t => {
    console.log(await exec());    
});
Your complete configuration file (if any):

Your complete test report:

Screenshots:

Steps to Reproduce:

  1. Go to my website ...
  2. Execute this command...
  3. See the error...

Your Environment details:

  • testcafe version: 1.2.1
  • node.js version: any
  • command-line arguments: testcafe chrome test.ts
  • browser name and version: any
  • platform and version: any
  • other:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions