© The Author(s), under exclusive license to APress Media, LLC , part of Springer Nature 2021
D. TangPro Ember Datahttps://doi.org/10.1007/978-1-4842-6561-1_10

10. Testing Adapters and Serializers

David Tang1  
(1)
Playa Vista, CA, USA
 

In this chapter, we’ll look at how to test adapters and serializers.

Testing Adapters

Whenever we generate an adapter, a corresponding unit test is generated. Here is the default test:
tests/unit/adapters/application-test.js
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Adapter | application', function (hooks) {
  setupTest(hooks);
  // Replace this with your real tests.
  test('it exists', function (assert) {
    let adapter = this.owner.lookup('adapter:application');
    assert.ok(adapter); ...

Get Pro Ember Data: Getting Ember Data to Work with Your API now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.