Slide 37
Slide 37 text
37
Today - Addons
import { setupPact, given, interaction } from 'ember-cli-pact';
// ...snip…
module('Pact | People', function(hooks) {
setupTest(hooks);
setupPact(hooks, { provider: 'my-api', consumer: 'my-app'});
test('locating a person by ID', async function(assert) {
given('a person exists', { id: '123', name: 'Alice' });
let person = await interaction(() =>
this.store().findRecord('person', '123'));
assert.equal(person.get('id'), '123');
assert.equal(person.get('name'), 'Alice');
});
});