Skip to content

EmberApplicationInstance willDestroy in settled.ts uses the wrong internalPendingRequests #1172

@raycohen

Description

@raycohen

upon updating ember-test-helpers, I have test code that resets the app hit the app instance willDestroy method, which errors on internalPendingRequests.clearPendingRequests() because internalPendingRequests is the (nonzero) integer result of calling the pendingRequests method.

Here's where the pendingRequests method is chained on the require that prevents accessing the other methods:

return loader.require('ember-testing/lib/test/pending_requests')
.pendingRequests;

error occurs here:

internalPendingRequests.clearPendingRequests();

likewise the off calls are passing undefined since internalPendingRequests is an integer and not a module

If you look at the deleted code in #1047 it was not chaining pendingRequests on the old require('ember-testing/lib/test/pending_requests') which allowed accessing the different methods from that module.

Is a PR welcome here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions