ReferenceError running jest testing

Jest tests throw the following error when using purecloud-platform-client-v2.

ReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From segments.test.js.

      at Configuration.updateConfigFromFile (node_modules/purecloud-platform-client-v2/dist/node/purecloud-platform-client-v2.js:305:25)
      at StatWatcher.<anonymous> (node_modules/purecloud-platform-client-v2/dist/node/purecloud-platform-client-v2.js:278:12)

This same issue has already been raised here, but the proposed solution of setting
client.config.live_reload_config = false; seems to have no effect.

  • node: v16.15.0
  • purecloud-platform-client-v2: 169.1.0
  • jest: 29.5.0

Hi,

Did you try the other solution: Can't use purecloud-platform-client-v2 with node.js/typescript - #10 by david.chiew ?

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.