From ee5939daa81c97f1ef732c1df39155ad4e63c57c Mon Sep 17 00:00:00 2001 From: Chris Thoburn Date: Thu, 26 Jul 2018 17:43:15 -0700 Subject: [PATCH] stub out tests for waiter --- tests/unit/store/async-leak-test.js | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/unit/store/async-leak-test.js diff --git a/tests/unit/store/async-leak-test.js b/tests/unit/store/async-leak-test.js new file mode 100644 index 00000000000..f1ab2242ab3 --- /dev/null +++ b/tests/unit/store/async-leak-test.js @@ -0,0 +1,44 @@ +import { module, test } from 'qunit'; +import JSONAPIAdapter from 'ember-data/adapters/json-api'; +import JSONAPISerializer from 'ember-data/serializers/json-api'; +import { setupTest } from 'ember-qunit'; +import Store from 'ember-data/store'; +import Model from 'ember-data/model'; +import { resolve, reject, Promise } from 'rsvp'; +import { attr } from '@ember-decorators/data'; + +class Person extends Model { + @attr name; +} + +module('unit/store async-waiter and leak detection', function(hooks) { + let store; + setupTest(hooks); + + hooks.beforeEach(function() { + let { owner } = this; + owner.register('service:store', Store); + owner.register('model:person', Person); + store = owner.lookup('service:store'); + }); + + test('await properly waits for pending requests', async function(assert) { + + }); + + test('await works even when the adapter rejects', async function(assert) { + + }); + + test('await works even when the adapter throws', async function(assert) { + + }); + + test('when the store is torn down too early, the waiter throws', async function(assert) { + + }); + + test('when configured, pending requests have useful stack traces', async function(assert) { + + }); +});