1

I am upgrading jest from version 23 to 29. My project used to work fine before the upgrade, suddenly started observing this issue. I use Typescript as a language.

TestPageDefs Module looks like below:

import { lxExplorer } from "../pageObjects/explorer/lxExplorer.pom";
export class TestPageDefs {

  // Page object files
  public static explorerPage: lxExplorer = new lxExplorer();

}

This is consumed in another module/class.

import { TestPageDefs } from "../../helpers/TestPageDefs";

export class lxLinkAnalysis extends  BasePluginPage<lxLinkAnalysis> {

public  ebsLinkClassifyCountQuery: string = TestPageDefs.explorerPage.ebsTableQuery + " | link    'Log Source' | classify Count";
}

Getting below error.

TypeError: Cannot read property 'explorerPage' of undefined

Error Message

I did tried other import like default or all imports (*). Nothing helped.

4
  • Are you sure that ../../helpers/TestPageDefs is the right module with the TestPageDefs named export? Commented Jun 12, 2024 at 4:15
  • Yes, as I am able to navigate to TestPageDefs by Pressing control and clicking on ../../helpers/TestPageDefs. Commented Jun 13, 2024 at 12:00
  • Thanks @Phil for looking into it and all helps are greatly appreciated. Commented Jun 13, 2024 at 12:08
  • 1
    It seems to be working with ts-jest 28 but not with ts-jest 29. Commented Jun 18, 2024 at 13:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.