Skip to content

Commit 3fcd884

Browse files
committed
test(kitsu): re-add bulk test
Accidently got removed during a git stash/pop
1 parent 2c31d42 commit 3fcd884

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

packages/kitsu/src/patch.spec.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,38 @@ describe('kitsu', () => {
5454
})
5555

5656
it('sends bulk data in request', async done => {
57+
expect.assertions(1)
58+
const api = new Kitsu({ headers: { Authorization: true } })
59+
mock.onPatch('/posts').reply(config => {
60+
expect(JSON.parse(config.data)).toEqual({
61+
data: [
62+
{
63+
id: '1',
64+
type: 'posts',
65+
attributes: {
66+
content: 'Hello World'
67+
}
68+
},
69+
{
70+
id: '2',
71+
type: 'posts',
72+
attributes: {
73+
content: 'Hey World'
74+
}
75+
}
76+
]
77+
})
78+
return [ 200 ]
79+
})
80+
api.patch('post', [
81+
{ id: '1', content: 'Hello World' },
82+
{ id: '2', content: 'Hey World' }
83+
]).catch(err => {
84+
done.fail(err)
85+
})
86+
done()
87+
})
88+
5789
it('throws an error if missing a JSON object body', async () => {
5890
expect.assertions(1)
5991
const api = new Kitsu()

0 commit comments

Comments
 (0)