Skip to content

Commit

Permalink
fix: background-worker compatibiltiy
Browse files Browse the repository at this point in the history
update transport tests

fix test suite

fix linting issues

fix linting issues

downgrade jest version number

package downgrade

fix test suite

cleanup comment

fix package version

linting

add comments on Cloudflare workers

add comments on Cloudflare workers

fix references to document

ts-standard for easier diff

remove async option

working on diffs

working on diffs

working on diffs

working on diffs

working on diffs

remove async

one more time

tests: add worker tests

tests: add worker tests

tests: add worker tests

use jasmine

use jasmine

remove jasmine from worker

remove jasmine from worker

one last try

circumvent fetch
  • Loading branch information
KonnorRogers committed Nov 28, 2022
1 parent 2a4dd4e commit 7be35e2
Show file tree
Hide file tree
Showing 21 changed files with 4,576 additions and 1,245 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ node_modules
*/**/dist
*/**/.DS_Store
*/**/node_modules

lerna-debug.log
browserstack.err
3 changes: 1 addition & 2 deletions packages/core/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
filterUrl,
formatCGIData,
getSourceForBacktrace,
runAfterNotifyHandlers, endpoint, isBrowserConfig, getCauses
runAfterNotifyHandlers, endpoint, getCauses
} from './util'
import {
Config,
Expand Down Expand Up @@ -206,7 +206,6 @@ export abstract class Client {
endpoint: endpoint(this.config.endpoint, '/v1/notices/js'),
maxObjectDepth: this.config.maxObjectDepth,
logger: this.logger,
async: isBrowserConfig(this.config) ? this.config.async : undefined,
}, payload)
.then(res => {
if (res.statusCode !== 201) {
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,12 @@ export type ProcessStats = {

export type TransportOptions = {
method: 'GET' | 'POST',
// @TODO: This should probably follow the fetch "HeadersInit"
// headers?: HeadersInit
headers?: Record<string, number | string | string[] | undefined>,
endpoint: string,
maxObjectDepth?: number,
logger: Logger
async?: boolean // don't like this here because it's only for browser
}

export type NoticeTransportPayload = {
Expand Down
2 changes: 2 additions & 0 deletions packages/js/jest-browser-setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const fetchMock = require('jest-fetch-mock')
fetchMock.enableFetchMocks()

0 comments on commit 7be35e2

Please sign in to comment.