Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
AndreyBelym opened this issue Jul 1, 2019 · 3 comments
Labels
AREA: client FREQUENCY: level 1 SYSTEM: driver TYPE: bug
Projects
Milestone

Comments

@AndreyBelym
Copy link
Contributor

AndreyBelym commented Jul 1, 2019

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:
@AndreyBelym AndreyBelym added TYPE: bug AREA: client SYSTEM: driver labels Jul 1, 2019
@AndreyBelym AndreyBelym added this to the Sprint #36 milestone Jul 1, 2019
@AlexKamaev AlexKamaev self-assigned this Jul 9, 2019
@AndreyBelym AndreyBelym added this to Driver in Bugs triage Jul 15, 2019
@AndreyBelym AndreyBelym modified the milestones: Sprint #36, Planned Jul 16, 2019
@AlexKamaev AlexKamaev removed their assignment Jul 17, 2019
@Disorrder
Copy link

Disorrder commented Aug 14, 2020

It happens also when you define a class into ClientFunction:

const fn = ClientFunction(() => {
    class Foo {
        // . . .
    }
});

@need-response-app need-response-app bot added the STATE: Need response label Aug 14, 2020
@alexey-lin
Copy link
Contributor

alexey-lin commented Aug 17, 2020

@Disorrder, Thank you for the information, we will take this into account.

@need-response-app need-response-app bot removed the STATE: Need response label Aug 17, 2020
@miherlosev
Copy link
Collaborator

miherlosev commented Jan 29, 2021

@AndreyBelym @Disorrder

I cannot reproduce the problems with testcafe@1.10.1.

Example to reproduce:

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

const fn = ClientFunction(() => {
    class Foo1 {
    }
});

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

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


test(`example`, async t => {
    console.log(await exec());    
    console.log(await fn());
});

Test report:
image

Bugs triage automation moved this from Driver to Closed Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AREA: client FREQUENCY: level 1 SYSTEM: driver TYPE: bug
Projects
Bugs triage
  
Closed
Development

No branches or pull requests

5 participants