Skip to content

Commit 63ed6c3

Browse files
sidoruk-svbillyvglizokm
authored
docs(javascript): update sentry-testkit page (#6445)
Co-authored-by: Billy Vong <billyvg@users.noreply.github.com> Co-authored-by: Liza Mock <lizka920@gmail.com>
1 parent a20e28a commit 63ed6c3

File tree

1 file changed

+14
-9
lines changed
  • src/platforms/javascript/common/configuration/sentry-testkit

1 file changed

+14
-9
lines changed

src/platforms/javascript/common/configuration/sentry-testkit/index.mdx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ description: "Learn how to assert that the right flow-tracking or error is being
66

77
When building tests for your application, you want to assert that the right flow-tracking or error is being sent to Sentry, but without really sending it to the Sentry servers. This way you won't swamp Sentry with false reports during test runs or other CI operations.
88

9-
Note: [Wix](https://wix.github.io/sentry-testkit/), a Sentry partner, maintains Sentry Testkit.
10-
11-
[Sentry Testkit](https://wix.github.io/sentry-testkit/) is a Sentry plugin that allows intercepting Sentry's reports and further inspection of the data being sent. It enables Sentry to work natively in your application, and by overriding the default Sentry's transport mechanism, the report is not really sent, but rather logged locally into the memory. This way, logged reports can be fetched later for your own usage, verification, or any other use you may have in your local developing/testing environment.
9+
[Sentry Testkit](https://zivl.github.io/sentry-testkit/) is a Sentry plugin that allows Sentry's reports to be intercepted for further data inspection. It enables Sentry to work natively in your application, by overriding Sentry's default transport mechanism, which makes it so that the report isn't really sent, but rather logged locally into memory. This way, logged reports can be fetched later for your own usage, verification, or any other purpose you may have in your local developing or testing environment.
1210

1311
## Installation
1412

@@ -30,16 +28,23 @@ Sentry.init({
3028
//... other configurations
3129
});
3230

33-
// then run any scenario that should call Sentry.catchException(...)
31+
test('collect error events', function () {
32+
// run any scenario that eventually calls Sentry.captureException(...)
33+
expect(testkit.reports()).toHaveLength(1);
34+
const report = testkit.reports()[0];
35+
expect(report).toHaveProperty(/*...*/);
36+
});
3437

35-
expect(testkit.reports()).toHaveLength(1);
36-
const report = testkit.reports()[0];
37-
expect(report).toHaveProperty(/*...*/);
38+
// Similarly for performance events
39+
test('collect performance events', function () {
40+
// run any scenario that eventually calls Sentry.startTransaction(...)
41+
expect(testkit.transactions()).toHaveLength(1);
42+
});
3843
```
3944

40-
You may see more usage examples in the [testing section](https://github.com/wix/sentry-testkit/tree/master/test) of sentry-testkit repository as well.
45+
You may see more usage examples in the [testing section](https://github.com/zivl/sentry-testkit/tree/master/test) of sentry-testkit repository as well.
4146

4247
### Testkit API
4348

4449
Sentry Testkit consists of a very simple and straightforward API.
45-
See the full API description and documentation in [Sentry Testkit Docs](https://wix.github.io/sentry-testkit/).
50+
See the full API description and documentation in [Sentry Testkit Docs](https://zivl.github.io/sentry-testkit/docs/api).

0 commit comments

Comments
 (0)