Sha256: 8eab8aa7bd754540d0dbea2396b288fc5e3fa28267e827df4c3f1c4598e50a32

Contents?: true

Size: 577 Bytes

Versions: 1

Compression:

Stored size: 577 Bytes

Contents

import { RSVP } from '@ember/-internals/runtime';
import { backburner } from '@ember/runloop';
import { isTesting } from '@ember/debug';
import { asyncStart, asyncEnd } from '../test/adapter';

RSVP.configure('async', function(callback, promise) {
  // if schedule will cause autorun, we need to inform adapter
  if (isTesting() && !backburner.currentInstance) {
    asyncStart();
    backburner.schedule('actions', () => {
      asyncEnd();
      callback(promise);
    });
  } else {
    backburner.schedule('actions', () => callback(promise));
  }
});

export default RSVP;

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
discourse-ember-source-3.6.0.0 dist/es/ember-testing/lib/ext/rsvp.js