Search code examples
node.jstestingautomated-teststestcafetsconfig

The 'tsConfigPath' option is deprecated and will be removed in the next major release. Use the 'compilerOptions.typescript.configPath' option instead


I started to get this warning message: The 'tsConfigPath' option is deprecated and will be removed in the next major release. Use the 'compilerOptions.typescript.configPath' option instead.

Did anyone here was able to do what it requires?

My code looks like this:

//let testcafe: TestCafe;
 let failed = 0;
 let testcafe = (createTestCafe as any)('localhost', 1337, 1338)
 //createTestCafe('localhost', 1337, 1338)
   .then((tc: any) => {
     testcafe = tc;
     const runner = testcafe.createRunner();
 
     return runner
       .tsConfigPath('./tsconfig.e2e.json')  // THIS IS WHERE I NEED TO CHANGE IT
       .src(TEST_SRC)
       .browsers(BROWSERS)
       .reporter(reporters)
       .filter(testFilter)
       .screenshots({
         path: SCREENSHOT_PATH,
         takeOnFails: true,
         fullPage: true,
       })
       .run({
         pageLoadTimeout: 30000,
         assertionTimeout: 30000,
         selectorTimeout: 30000,
         debugMode: DEBUG === 'true',
       });
   })

How do i change it to make it work and remove that warning??


Solution

  • Just replace the .tsConfigPath('.tsconfig.e2e.json') line with the following code:

    .compilerOptions({
      typescript: {
        configPath: 'tsconfig.e2e.json'
      }
    })
    

    See more information about the method here: Runner.compilerOptions.