Skip to content

Commit

Permalink
Replace toBeCalledWith calls with its canonical version
Browse files Browse the repository at this point in the history
  • Loading branch information
eaviles committed Nov 29, 2018
1 parent c591875 commit 30c0a3b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/stream.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('lib/stream', () => {

test("activate creates a stream if it's doesn't exists and auto-create is on", async () => {
await expect(stream.activate(ctx)).resolves.toMatch(/^arn:aws:kinesis/);
expect(client.createStream).toBeCalledWith({ ShardCount: 1, StreamName: 'foo' });
expect(client.createStream).toHaveBeenCalledWith({ ShardCount: 1, StreamName: 'foo' });
expect(logger.debug.mock.calls).toEqual([
['Checking if the stream "foo" exists…'],
['Trying to create the stream…'],
Expand Down Expand Up @@ -82,7 +82,7 @@ describe('lib/stream', () => {
const mockStream = { StreamARN: 'bar', StreamName: 'foo', StreamStatus: 'DELETING' };
mockStreams().push(mockStream);
await expect(stream.activate(ctx)).resolves.toMatch('bar');
expect(client.createStream).toBeCalledWith({ ShardCount: 1, StreamName: 'foo' });
expect(client.createStream).toHaveBeenCalledWith({ ShardCount: 1, StreamName: 'foo' });
expect(logger.debug.mock.calls).toEqual([
['Checking if the stream "foo" exists…'],
['The stream status is DELETING.'],
Expand All @@ -99,7 +99,7 @@ describe('lib/stream', () => {
const mockStream = { StreamName: 'foo', StreamStatus: 'ACTIVE', EncryptionType: 'NONE' };
mockStreams().push(mockStream);
await expect(stream.encrypt(ctx)).resolves.not.toBeDefined();
expect(client.startStreamEncryption).toBeCalledWith({
expect(client.startStreamEncryption).toHaveBeenCalledWith({
EncryptionType: 'baz',
KeyId: 'qux',
StreamName: 'foo'
Expand Down Expand Up @@ -132,7 +132,7 @@ describe('lib/stream', () => {
};
mockStreams().push(mockStream);
await expect(stream.tag(ctx)).resolves.not.toBeDefined();
expect(client.addTagsToStream).toBeCalledWith({
expect(client.addTagsToStream).toHaveBeenCalledWith({
StreamName: 'foo',
Tags: { baz: 'qux', corge: 'grault', quux: 'quuz' }
});
Expand All @@ -151,7 +151,7 @@ describe('lib/stream', () => {
};
mockStreams().push(mockStream);
await stream.tag(ctx);
expect(client.addTagsToStream).toBeCalledWith({
expect(client.addTagsToStream).toHaveBeenCalledWith({
StreamName: 'foo',
Tags: { baz: 'qux', corge: 'grault' }
});
Expand Down

0 comments on commit 30c0a3b

Please sign in to comment.