Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Nov 5, 2024
1 parent 689dc9e commit 33a9273
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 155 deletions.
140 changes: 0 additions & 140 deletions test-app/tests/acceptance/root-test.js

This file was deleted.

23 changes: 11 additions & 12 deletions test-app/tests/unit/error-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { module, test } from 'qunit';
import { Response } from 'fetch';

import {
isUnauthorizedResponse,
Expand All @@ -10,47 +9,47 @@ import {
isBadRequestResponse,
isServerErrorResponse,
isAbortError,
isConflictResponse
isConflictResponse,
} from 'ember-fetch/errors';

module('Errors', function() {
test('isUnauthorizedResponse', function(assert) {
module('Errors', function () {
test('isUnauthorizedResponse', function (assert) {
assert.ok(isUnauthorizedResponse(new Response(null, { status: 401 })));
});

test('isForbiddenResponse', function(assert) {
test('isForbiddenResponse', function (assert) {
assert.ok(isForbiddenResponse(new Response(null, { status: 403 })));
});

test('isNotFoundResponse', function(assert) {
test('isNotFoundResponse', function (assert) {
assert.ok(isNotFoundResponse(new Response(null, { status: 404 })));
assert.notOk(isNotFoundResponse(new Response(null, { status: 400 })));
});

test('isGoneResponse', function(assert) {
test('isGoneResponse', function (assert) {
assert.ok(isGoneResponse(new Response(null, { status: 410 })));
assert.notOk(isGoneResponse(new Response(null, { status: 400 })));
});

test('isInvalidResponse', function(assert) {
test('isInvalidResponse', function (assert) {
assert.ok(isInvalidResponse(new Response(null, { status: 422 })));
});

test('isBadRequestResponse', function(assert) {
test('isBadRequestResponse', function (assert) {
assert.ok(isBadRequestResponse(new Response(null, { status: 400 })));
});

test('isServerErrorResponse', function(assert) {
test('isServerErrorResponse', function (assert) {
assert.notOk(isServerErrorResponse(new Response(null, { status: 499 })));
assert.ok(isServerErrorResponse(new Response(null, { status: 500 })));
assert.ok(isServerErrorResponse(new Response(null, { status: 599 })));
});

test('isAbortError', function(assert) {
test('isAbortError', function (assert) {
assert.ok(isAbortError(new DOMException('AbortError', 'AbortError')));
});

test('isConflictResponse', function(assert) {
test('isConflictResponse', function (assert) {
assert.ok(isConflictResponse(new Response(null, { status: 409 })));
});
});
5 changes: 2 additions & 3 deletions test-app/tests/unit/headers-test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { module, test } from 'qunit';
import { Headers } from 'fetch';

module('Headers', function() {
test('iterator', function(assert) {
module('Headers', function () {
test('iterator', function (assert) {
let headers = new Headers();

assert.ok(headers[Symbol.iterator]);
Expand Down

0 comments on commit 33a9273

Please sign in to comment.