Skip to content

Commit

Permalink
feat(core/options): maxDuplicateCount default to 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jinhuochen committed Jun 25, 2021
1 parent d1cea46 commit e484a49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class Options {
includeHttpUrlTraceIdRegExp: RegExp
traceIdFieldName = 'Trace-Id'
throttleDelayTime = 0
maxDuplicateCount = 10
maxDuplicateCount = 2
// wx-mini
appOnLaunch: Function = () => {}
appOnShow: Function = () => {}
Expand Down
8 changes: 5 additions & 3 deletions test/unit/core/errorId.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('errorId.ts', () => {
expect(errorId_1).toBe(errorId_2)
})

it('一个错误对象生成两次后,第三次会返回null', () => {
it('一个错误对象生成两次后,默认情况下第三次会返回null,可配置maxDuplicateCount', () => {
const logError_1: ReportDataType = {
type: ERRORTYPES.LOG_ERROR,
level: Severity.Critical,
Expand Down Expand Up @@ -139,11 +139,13 @@ describe('errorId.ts', () => {
// todo 需要支持browser history
})
it('should getFlutterRealPath func work', () => {
const url = 'file:///var/mobile/Containers/Data/Application/D1A0783A-2495-41B4-8599-EC58B5B252CD/Documents/SailerBuild/36/index.html?/#/search-page'
const url =
'file:///var/mobile/Containers/Data/Application/D1A0783A-2495-41B4-8599-EC58B5B252CD/Documents/SailerBuild/36/index.html?/#/search-page'
expect(getFlutterRealPath(url)).toBe('SailerBuild/36/index.html?/#/search-page')
})
it('should getFlutterRealOrigin func work', () => {
const url = 'file:///var/mobile/Containers/Data/Application/D1A0783A-2495-41B4-8599-EC58B5B252CD/Documents/SailerBuild/36/index.html?/#/search-page'
const url =
'file:///var/mobile/Containers/Data/Application/D1A0783A-2495-41B4-8599-EC58B5B252CD/Documents/SailerBuild/36/index.html?/#/search-page'
expect(getFlutterRealOrigin(url)).toBe('SailerBuild/36/index.html?')
})
})

0 comments on commit e484a49

Please sign in to comment.