Skip to content

Commit

Permalink
test(types): Add more thorough tests for type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
bengourley committed Dec 20, 2019
1 parent ae6753b commit bc09a07
Show file tree
Hide file tree
Showing 10 changed files with 625 additions and 137 deletions.
6 changes: 3 additions & 3 deletions packages/browser/types/test/fixtures/all-options.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import bugsnag, { Bugsnag } from "../../.."
import bugsnag, { Breadcrumb, Session } from "../../.."
bugsnag({
apiKey: "abc",
appVersion: "1.2.3",
Expand All @@ -8,11 +8,11 @@ bugsnag({
onError: [
event => true
],
onBreadcrumb: (b: Bugsnag.Breadcrumb) => {
onBreadcrumb: (b: Breadcrumb) => {
console.log(b.message)
return false
},
onSession: (s: Bugsnag.Session) => {
onSession: (s: Session) => {
console.log(s.id)
return true
},
Expand Down
6 changes: 3 additions & 3 deletions packages/browser/types/test/fixtures/exposed-types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Bugsnag } from "../../..";
let bugsnagInstance: Bugsnag.Client | undefined = undefined;
export function notify(error: Bugsnag.NotifiableError, onError?: Bugsnag.OnError): void {
import { Client, AbstractTypes } from "../../..";
let bugsnagInstance: Client | undefined = undefined;
export function notify(error: AbstractTypes.NotifiableError, onError?: AbstractTypes.OnErrorCallback): void {
if (bugsnagInstance === undefined) {
return
}
Expand Down
4 changes: 4 additions & 0 deletions packages/core/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports.Breadcrumb = require('./breadcrumb')
module.exports.Client = require('./client')
module.exports.Event = require('./event')
module.exports.Session = require('./session')

0 comments on commit bc09a07

Please sign in to comment.