Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ESRI JS Promise never resolves in intern tests

See original GitHub issue

Test that include an ESRI JS Promise never resolves in intern tests and test fails with the following error:

TimeoutError: Timeout reached on chrome 75.0.3770.100 on Mac OS X - widgets/App/AppViewModel - should resolve ESRI Promise#
      @ node_modules/intern/browser/remote.js:99:10665  


ESRI JS Promise never resolves but “classic” one does resolve and test succeed. For example, in any test suite add the following sample:

import esriRequest from "esri/request";

test("should resolve ESRI Promise", async () => {
      return esriRequest('', {
        responseType: "json"
        assert.equal(, '10.6');

 test("should resolve a Promise", () => {
      function solvePromise(resolve:any, reject:any) {
        const req = new XMLHttpRequest();
        req.onreadystatechange = function(event) {
            if (this.readyState === XMLHttpRequest.DONE) {
                if (this.status === 200) {
        };'GET', '', true);

      var promise = new Promise(solvePromise);
      return promise.then(function(value:string) {
        assert.equal(JSON.parse(value).currentVersion, '10.6');

Test ‘should resolve ESRI Promise’ never resolve and fails with a timeout error but ‘should resolve a Promise’ does resolve and test succeeds.

Expected Behavior

ESRI JS Promise should resolve in intern tests and test should be successful.

Actual Behavior

ESRI JS Promise never resolves in intern test and test fails.

Possible Fix

No idea

Steps to Reproduce

  1. Include import esriRequest from "esri/request"; in any test suite
  2. Copy paste the 2 tests described above
  3. Run npm test


I cannot test any function that returns an ESRI JS Promise

Your Environment

  • Version used: 4.11.0
  • Browser Name and version: Chrome Version 75.0.3770.100

Any idea @odoe ? Thanks !

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

Bibobacommented, Jul 5, 2019

@jason0x43 found the trick ! In webpack test config, output.publicPath should be set to ‘/~tmp/’.

Bibobacommented, Jul 3, 2019

Reading this post, I now understand why you wanted to wait for 4.12: nativ fetch will be used so my test might be successful. But I think the issue would still occur whenever a test will be executing ESRI JS code that will be doing a dynamic import just like “esri/request” is 4.11. Let’s see what see what the open issue on intern will say.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot test/run async code · Issue #23 · Esri/arcgis-js-cli · GitHub
It should be possible to test asynchronous job. Actual Behavior. 404 errors in console, and promise never resolved so tests never successful. Possible...
Read more >
FeatureLayer Promise Doesn't Resolve - Esri Community
Solved: Hello All, I'm creating FeatureLayer objects from SubLayer objects in order to use them as sources in a Search widget.
Read more >
Javascript promise never resolves - typescript - Stack Overflow
I would expect to see "test" after successful completion, but the promise never resolves. If I use await, it hangs on the await...
Read more >
COVID-19 Vaccination and Testing; Emergency Temporary ...
Other types of work settings that were affected in resolved outbreaks included ... OSHA has never done so, and if it were to...
Read more >
COVID-19 Vaccination and Testing; Emergency Temporary ...
OSHA-2021-0007] RIN 1218-AD42 COVID-19 Vaccination and Testing; ... people who are infected but never feel any symptoms of COVID-19), ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found