Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test to prove ember-fetch@8 works with the current test-waiter system/integration #471

Merged
merged 1 commit into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions test-apps/ember-fetch-v8/public/test-file.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"greeting": "hello there!"
}
19 changes: 19 additions & 0 deletions test-apps/ember-fetch-v8/tests/ember-fetch-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import { settled } from '@ember/test-helpers';
// this is bad, because fetch is actually ember-fetch, and we didn't install "fetch"
import fetch from 'fetch';

module('ember-fetch@8', function (hooks) {
setupTest(hooks);

test('it waits for the fetch to be done', async function (assert) {
const promise = fetch('test-file.json');

assert.strictEqual(promise._state, undefined);
assert.strictEqual(promise._result, undefined);
await settled();
assert.strictEqual(promise._state, 1);
assert.strictEqual(promise._result?.statusText, 'OK');
});
});
43 changes: 0 additions & 43 deletions test-apps/ember-fetch-v8/tests/helpers/index.ts

This file was deleted.

Empty file.
Empty file.
Loading