Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PLAT-5961] feat(browser,node): Add default appType config #1415

Merged
merged 3 commits into from
May 20, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- (react-native): Update bugsnag-cocoa to v6.9.2
- Add a mechanism for reporting errors that occur within the notifier. [bugsnag-cocoa#1089](https://github.com/bugsnag/bugsnag-cocoa/pull/1089)
- Fix compiler warnings when additional warning flags are enabled. [bugsnag-cocoa#1092](https://github.com/bugsnag/bugsnag-cocoa/pull/1092) [bugsnag-cocoa#1094](https://github.com/bugsnag/bugsnag-cocoa/pull/1094)
- (browser,node): Add default `appType`

### Fixed

Expand Down
4 changes: 4 additions & 0 deletions packages/browser/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ module.exports = {
return 'production'
}
}),
appType: {
...schema.appType,
defaultValue: () => 'browser'
},
logger: assign({}, schema.logger, {
defaultValue: () =>
// set logger based on browser capability
Expand Down
4 changes: 4 additions & 0 deletions packages/node/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ const os = require('os')
const { inspect } = require('util')

module.exports = {
appType: {
...schema.appType,
defaultValue: () => 'node'
imjoehaines marked this conversation as resolved.
Show resolved Hide resolved
},
projectRoot: {
defaultValue: () => process.cwd(),
validate: value => value === null || stringWithLength(value),
Expand Down
1 change: 1 addition & 0 deletions test/browser/features/handled_errors.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Scenario Outline: calling notify() with Error
And the exception "errorClass" equals "Error"
And the exception "message" equals "bad things"
And the exception "type" equals "browserjs"
And the error payload field "events.0.app.type" equals "browser"
And event 0 is handled

Examples:
Expand Down
1 change: 1 addition & 0 deletions test/browser/features/unhandled_errors.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Scenario: syntax errors
Then I wait to receive an error
And the error is a valid browser payload for the error reporting API
And the exception matches the "unhandled_syntax" values for the current browser
And the error payload field "events.0.app.type" equals "browser"
And event 0 is unhandled

Scenario: thrown errors
Expand Down