mirror of
https://github.com/datahub-project/datahub.git
synced 2025-07-19 07:30:54 +00:00
16 lines
561 B
JavaScript
16 lines
561 B
JavaScript
import { throwIfApiError } from 'wherehows-web/utils/api/errors/errors';
|
|
import { module, test } from 'qunit';
|
|
|
|
module('Unit | Utility | api/errors/errors');
|
|
|
|
test('throwIfApiError exists', function(assert) {
|
|
assert.ok(typeof throwIfApiError === 'function', 'throwIfApiError exists as a function');
|
|
});
|
|
|
|
test('throwIfApiError returns a Promise / thennable', function(assert) {
|
|
assert.ok(
|
|
typeof throwIfApiError({ status: 200, ok: true, json: () => Promise.resolve() }).then === 'function',
|
|
'invocation returns a Promise object / thennable'
|
|
);
|
|
});
|