-
Notifications
You must be signed in to change notification settings - Fork 214
Migrate browser.core.test.js to ts, update sinon, add nise, fix types
#1445
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,6 +76,7 @@ export default defineConfig( | |
|
|
||
| // disabled for now | ||
| '@typescript-eslint/no-explicit-any': 'off', | ||
| '@typescript-eslint/ban-ts-comment': ['error', { 'ts-nocheck': false }], | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Temporary until all new TS tests are migrated |
||
| }, | ||
| }, | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,11 @@ function App() { | |
| accessToken: 'POST_CLIENT_ITEM_TOKEN', | ||
| captureUncaught: true, | ||
| captureUnhandledRejections: true, | ||
| person: { | ||
| id: '12345', | ||
| name: 'Test User', | ||
| email: '[email protected]', | ||
| }, | ||
matux marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This wasn't working before this update. |
||
| })); | ||
|
|
||
| const logInfo = () => { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
|
|
||
| export default Rollbar; | ||
|
|
||
| declare class Rollbar { | ||
| declare class Rollbar implements Rollbar.Components { | ||
| constructor(options?: Rollbar.Configuration); | ||
| static init(options: Rollbar.Configuration): Rollbar; | ||
| static setComponents(components: Rollbar.Components): void; | ||
|
|
@@ -34,12 +34,30 @@ declare class Rollbar { | |
|
|
||
| public errorHandler(): Rollbar.ExpressErrorHandler; | ||
|
|
||
| // Components | ||
|
|
||
| public telemeter?: TelemeterType; | ||
| public instrumenter?: InstrumenterType; | ||
| public wrapGlobals?: WrapGlobalsType; | ||
| public scrub?: ScrubType; | ||
| public truncation?: TruncationType; | ||
| public tracing?: TracingType; | ||
| /** | ||
| * Replay component for session recording. | ||
| * Only available when using replay bundles (rollbar.replay.*). | ||
| * Use `import Rollbar from 'rollbar/replay'` to access. | ||
| */ | ||
| public replay?: ReplayType; | ||
|
Comment on lines
+37
to
+50
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Couldn't find a way not to repeat this from |
||
|
|
||
| // Used with rollbar-react for rollbar-react-native compatibility. | ||
| public rollbar: Rollbar; | ||
|
|
||
| // Exposed only for testing, should be changed via the configure method | ||
| // DO NOT MODIFY DIRECTLY | ||
| public options: Rollbar.Configuration; | ||
|
|
||
| // Exposed only for testing, tracks pending anonymous errors | ||
| anonymousErrorsPending: number; | ||
| } | ||
|
|
||
| declare namespace Rollbar { | ||
|
|
@@ -111,6 +129,7 @@ declare namespace Rollbar { | |
| ) => void; | ||
| overwriteScrubFields?: boolean; | ||
| payload?: Payload; | ||
| person?: PersonParams; | ||
| replay?: ReplayOptions; | ||
| reportLevel?: Level; | ||
| resource?: StringAttributes; | ||
|
|
@@ -311,6 +330,13 @@ declare namespace Rollbar { | |
| transformSpan?: (params: TransformSpanParams) => void; | ||
| } | ||
|
|
||
| export interface PersonParams { | ||
| id: string | DeprecatedNumber | null; | ||
| username?: string; | ||
| email?: string; | ||
| [property: string]: any; | ||
| } | ||
|
|
||
| /** | ||
| * @deprecated number is deprecated for this field | ||
| */ | ||
|
|
@@ -320,12 +346,7 @@ declare namespace Rollbar { | |
| * {@link https://docs.rollbar.com/docs/rollbarjs-configuration-reference#payload-1} | ||
| */ | ||
| export interface Payload { | ||
| person?: { | ||
| id: string | DeprecatedNumber | null; | ||
| username?: string; | ||
| email?: string; | ||
| [property: string]: any; | ||
| }; | ||
| person?: PersonParams; | ||
| context?: any; | ||
| client?: { | ||
| javascript?: { | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,8 +97,9 @@ | |
| "@babel/preset-typescript": "^7.28.5", | ||
| "@types/chai": "^4.3.20", | ||
| "@types/mocha": "^10.0.10", | ||
| "@types/nise": "^1.4.5", | ||
| "@types/node": "^20.17.12", | ||
| "@types/sinon": "^10.0.20", | ||
| "@types/sinon": "^21.0.0", | ||
| "@web/dev-server-esbuild": "^1.0.4", | ||
| "@web/test-runner": "^0.20.2", | ||
| "@web/test-runner-mocha": "^0.9.0", | ||
|
|
@@ -116,10 +117,11 @@ | |
| "glob": "^5.0.14", | ||
| "globals": "^16.5.0", | ||
| "mocha": "^11.1.0", | ||
| "nise": "^6.1.1", | ||
| "nock": "^11.9.1", | ||
| "node-libs-browser": "^0.5.2", | ||
| "prettier": "^3.6.2", | ||
| "sinon": "^8.1.1", | ||
| "sinon": "^21.0.0", | ||
|
Comment on lines
+120
to
+124
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tried to keep the old |
||
| "ts-node": "^10.9.2", | ||
| "typescript": "^5.9.3", | ||
| "typescript-eslint": "^8.46.4", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tell vscode to use the sdk's typescript.