Legacy Dev Forum Posts

 View Only

Sign Up

ReferenceError running jest testing

  • 1.  ReferenceError running jest testing

    Posted 06-05-2025 18:03

    sam1 | 2023-06-08 23:44:15 UTC | #1

    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

    Ebenezer_Osei | 2023-06-12 20:25:15 UTC | #2

    Hi,

    Did you try the other solution: https://developer.genesys.cloud/forum/t/cant-use-purecloud-platform-client-v2-with-node-js-typescript/12151/10?u=ebenezer_osei ?


    system | 2023-07-13 20:25:55 UTC | #3

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


    This post was migrated from the old Developer Forum.

    ref: 20336