Skip to content

Commit

Permalink
replaces toHaveBeenLastCalledWith with toHaveBeenNthCalledWith
Browse files Browse the repository at this point in the history
  • Loading branch information
dhurley14 committed Aug 9, 2021
1 parent 36838ab commit 04044f5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ describe('bulkUpdate()', () => {
index: indexName,
status: 'closed',
});
expect(auditLogger.log).toHaveBeenLastCalledWith({
expect(auditLogger.log).toHaveBeenNthCalledWith(1, {
message: `User is updating alert [id=${fakeAlertId}]`,
event: {
action: 'alert_update',
Expand Down Expand Up @@ -154,7 +154,7 @@ describe('bulkUpdate()', () => {
})
).rejects.toThrowErrorMatchingInlineSnapshot(`"Unauthorized for fake.rule and apm"`);

expect(auditLogger.log).toHaveBeenLastCalledWith({
expect(auditLogger.log).toHaveBeenNthCalledWith(1, {
message: `Failed attempt to update alert [id=${fakeAlertId}]`,
event: {
action: 'alert_update',
Expand Down Expand Up @@ -351,7 +351,7 @@ describe('bulkUpdate()', () => {
Error: Error: Unauthorized for fake.rule and apm"
`);

expect(auditLogger.log).toHaveBeenLastCalledWith({
expect(auditLogger.log).toHaveBeenNthCalledWith(1, {
message: `Failed attempt to update alert [id=${fakeAlertId}]`,
event: {
action: 'alert_update',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ describe('get()', () => {
Error: Error: Unauthorized for fake.rule and apm"
`);

expect(auditLogger.log).toHaveBeenLastCalledWith({
expect(auditLogger.log).toHaveBeenNthCalledWith(1, {
message: `Failed attempt to access alert [id=${fakeAlertId}]`,
event: {
action: 'alert_get',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ describe('update()', () => {
Error: Error: Unauthorized for fake.rule and apm"
`);

expect(auditLogger.log).toHaveBeenLastCalledWith({
expect(auditLogger.log).toHaveBeenNthCalledWith(1, {
message: `Failed attempt to update alert [id=${fakeAlertId}]`,
event: {
action: 'alert_update',
Expand Down

0 comments on commit 04044f5

Please sign in to comment.