Skip to content

Commit

Permalink
✅[e2e cbt] fix wrong expectation
Browse files Browse the repository at this point in the history
on safari, there is a resource event for the current page
  • Loading branch information
bcaudan committed Dec 4, 2019
1 parent 01aa64a commit 34124d4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/e2e/scenario/agents.scenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
tearDown,
withBrowserLogs,
} from './helpers'
import { strictlyPositiveNumber } from './matchers'
import { positiveNumber, strictlyPositiveNumber } from './matchers'

beforeEach(() => {
// tslint:disable-next-line: no-unsafe-any
Expand Down Expand Up @@ -121,7 +121,7 @@ describe('rum', () => {
error_count: 0,
load_event_end: strictlyPositiveNumber(),
long_task_count: 0,
resource_count: 0,
resource_count: positiveNumber(), // some browsers can send a resource for the page load
user_action_count: 0,
} as any)
})
Expand Down
14 changes: 13 additions & 1 deletion test/e2e/scenario/matchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,20 @@ class StrictlyPositiveNumber {
}

jasmineToString() {
return '<positiveNumber>'
return '<strictlyPositiveNumber>'
}
}

export const strictlyPositiveNumber = () => new StrictlyPositiveNumber()

class PositiveNumber {
asymmetricMatch(other: any) {
return typeof other === 'number' && !isNaN(other) && other >= 0
}

jasmineToString() {
return '<positiveNumber>'
}
}

export const positiveNumber = () => new StrictlyPositiveNumber()

0 comments on commit 34124d4

Please sign in to comment.