Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.
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
4 changes: 2 additions & 2 deletions tests/unit/adapters/application-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ test('#fetch handles 204 (Success, no content) response status w/o calling deser
sandbox.stub(adapter, 'fetchUrl', function () {});
mockFetchJax(sandbox, adapter, '');
sandbox.stub(adapter, 'cacheResource', function () {});
adapter.serializer = {deserialize: sandbox.spy(), deserializeIncluded: Ember.K};
adapter.serializer = {deserialize: sandbox.spy(), deserializeIncluded() {}};
let promise = adapter.fetch('/posts', {method: 'PATCH', body: '{"data": null}'});

assert.ok(typeof promise.then === 'function', 'returns a thenable');
Expand All @@ -940,7 +940,7 @@ test('#fetch handles 200 (Success) response status', function(assert) {
const adapter = this.subject({type: 'posts', url: '/posts'});
mockFetchJax(sandbox, adapter, postMock);
sandbox.stub(adapter, 'cacheResource', function () {});
adapter.serializer = { deserialize: sandbox.spy(), deserializeIncluded: Ember.K };
adapter.serializer = { deserialize: sandbox.spy(), deserializeIncluded() {} };
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cibernox nice, thanks for the fix. So named function declaration in shorthand syntax . Sweet. deserializeIncluded() {} and clean

let promise = adapter.fetch('/posts/1', { method: 'GET' });

assert.ok(typeof promise.then === 'function', 'returns a thenable');
Expand Down
7 changes: 3 additions & 4 deletions tests/unit/mixins/resource-operations-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Ember from 'ember';
import RSVP from 'rsvp';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cibernox after removing Ember.K the import was no longer needed.

// import ResourceOperationsMixin from 'ember-jsonapi-resources/mixins/resource-operations';
import { module, test } from 'qunit';
Expand All @@ -20,12 +19,12 @@ module('Unit | Mixin | resource-operations', {
createRelationship: this.sandbox.spy(promiseResolved),
patchRelationship: this.sandbox.spy(promiseResolved),
deleteRelationship: this.sandbox.spy(promiseResolved),
trigger: Ember.K
trigger() {}
},
name: attr('string'),
// mock relationship computed properties
guns: {kind: 'toMany', mapBy: Ember.K }, // toMany('guns')
horse: {kind: 'toOne', get: Ember.K } // toOne('horse')
guns: {kind: 'toMany', mapBy() {} }, // toMany('guns')
horse: {kind: 'toOne', get() {} } // toOne('horse')
});
this.subject = Cowboy.create({ id: 1, name:'Lone Ranger'});
// mock payload setup
Expand Down