testcafe icon indicating copy to clipboard operation
testcafe copied to clipboard

Running testcafe suite throws Error 'minimatch' that fails Typescript compilation after updating to the Latest 3.7.0 version.

Open SamShot81 opened this issue 6 months ago • 5 comments

What is your Scenario?

I am trying to run the testcases locally that I do everyday. I updated the testcafe to version 3.7.0 and ran the same suite and saw the following error :

Cannot prepare tests due to the following error:

Error: TypeScript compilation failed. Cannot find type definition file for 'minimatch'. The file is in the program because: Entry point for implicit type library 'minimatch'

What is the Current behavior?

No tests are run

What is the Expected behavior?

The test should run normally like the past versions

What is the public URL of the test page? (attach your complete example)

https://portal.fsm.epicor.com/Identity/Account/Login

What is your TestCafe test code?

I have 1000 testcases running successfully before updating testcafe

Your complete configuration file

module.exports = { selectorTimeout: 3000, assertionTimeout: 3000, skipJsErrors: true, hooks: {

// fixture:{
//   before: async (t) => {
//     await t
//       .maximizeWindow();
//   }
// },
test: {
  before: async (t) => {
    await t

      .maximizeWindow();

  },
},
reporter: {
  onBeforeWrite: {
    'spec': hookFunction
  },
},

}, };

let i = 1 function hookFunction(writeInfo, testRuninfo, name) { if (writeInfo.initiator === 'reportTestDone') { // Determine the reporter event const dateTime = new Date().toLocaleString('en-US', { timeZone: 'GMT' }); writeInfo.formattedText = i++ + " - " + dateTime + writeInfo.formattedText; //writeInfo.formattedText = "NUMBER OF TEST EXECUTED : " + (++i) }; }

Your complete test report

Screenshots

Image

Steps to Reproduce

TestCafe version

3.7.2

Node.js version

21.6.2

Command-line arguments

testcafe chrome filepath.js

Browser name(s) and version(s)

Chrome

Platform(s) and version(s)

Windows

Other

No response

SamShot81 avatar Jul 08 '25 18:07 SamShot81

We appreciate you taking the time to share information about this issue. We reproduced the bug and added this ticket to our internal task queue. We'll update this thread once we have news.

github-actions[bot] avatar Jul 09 '25 09:07 github-actions[bot]

Hello, while we're working on the fix, you can use the following workaround. In your package.json add the following override:

"overrides": { "testcafe-browser-tools": { "del": "^6.1.1" } }

Bayheck avatar Aug 06 '25 11:08 Bayheck

Hi, workaround not working for yarn. For npm newest version 3.7.2 is working fine, without workaround.

bartoszwalicki avatar Nov 13 '25 22:11 bartoszwalicki

Hi @bartoszwalicki,

Please try using the resolutions section in package.json. It provides functionality in the Yarn package manager similar to the overrides feature in npm. For more details, see the Yarn documentation: https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/#toc-why-would-you-want-to-do-this

aleks-pro avatar Nov 19 '25 10:11 aleks-pro

Actually I used custom tsconfig and problem is solved for me. For reference:

tsconfig.ts

{
  "compilerOptions": {
    "allowJs": true,
    "strict": true,
    "outDir": "./lib",
    "sourceMap": false,
    "noImplicitAny": false,
    "noResolve": false,
    "module": "commonjs",
    "moduleResolution": "node",
    "target": "es6",
    "types": ["node", "testcafe"],
    "lib": ["dom", "es6", "es2017"]
  }
}

.tescaferc.js

module.exports = {
  compilerOptions: {
    typescript: { configPath: './tsconfig.json' },
  },
  skipJsErrors: true,
  skipUncaughtErrors: true,
};

bartoszwalicki avatar Nov 19 '25 11:11 bartoszwalicki