Skip to content

Commit e8be995

Browse files
author
Luca Forstner
authored
Merge branch 'develop' into lforst-truncation-logic
2 parents 1273c20 + 7191ebd commit e8be995

File tree

97 files changed

+1390
-2118
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1390
-2118
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = {
3838
},
3939
},
4040
{
41-
files: ['jest/**/*.ts', 'scripts/**/*.ts'],
41+
files: ['scripts/**/*.ts'],
4242
parserOptions: {
4343
project: ['tsconfig.dev.json'],
4444
},

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ scratch/
1717
# side effects of running AWS lambda layer zip action locally
1818
dist-serverless/
1919
sentry-node-serverless-*.zip
20-
# transpiled transformers
21-
jest/transformers/*.js
2220
# node tarballs
2321
packages/*/sentry-*.tgz
2422
.nxcache

.vscode/launch.json

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -52,35 +52,6 @@
5252
"internalConsoleOptions": "openOnSessionStart",
5353
"outputCapture": "std"
5454
},
55-
// Run a specific test file in watch mode (must have file in currently active tab when hitting the play button).
56-
// NOTE: If you try to run this and VSCode complains that the command `shellCommand.execute` can't be found, go
57-
// install the recommended extension Tasks Shell Input.
58-
{
59-
"name": "Debug unit tests - just open file",
60-
"type": "node",
61-
"cwd": "${workspaceFolder}/packages/${input:getPackageName}",
62-
"request": "launch",
63-
"program": "${workspaceFolder}/node_modules/.bin/jest",
64-
"args": [
65-
"--watch",
66-
// this runs one test at a time, rather than running them in parallel (necessary for debugging so that you know
67-
// you're hitting a single test's breakpoints, in order)
68-
"--runInBand",
69-
// coverage messes up the source maps
70-
"--coverage",
71-
"false",
72-
// remove this to run all package tests
73-
"${relativeFile}"
74-
],
75-
"sourceMaps": true,
76-
"smartStep": true,
77-
// otherwise it goes to the VSCode debug terminal, which prints the test output or console logs (depending on
78-
// "outputCapture" option here; default is to show console logs), but not both
79-
"console": "integratedTerminal",
80-
// since we're not using it, don't automatically switch to it
81-
"internalConsoleOptions": "neverOpen"
82-
},
83-
8455
// Run a specific test file in watch mode (must have file in currently active tab when hitting the play button).
8556
// NOTE: If you try to run this and VSCode complains that the command `shellCommand.execute` can't be found, go
8657
// install the recommended extension Tasks Shell Input.

CONTRIBUTING.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,6 @@ the tests in each location. Check out the `scripts` entry of the corresponding `
7373

7474
Note: you must run `yarn build` before `yarn test` will work.
7575

76-
## Debugging Tests
77-
78-
If you run into trouble writing tests and need to debug one of them, you can do so using VSCode's debugger.
79-
80-
0. If you don't already have it installed, install the Tasks Shell Input extension, which you'll find in the Extensions
81-
tab in the sidebar as one of the recommended workspace extensions.
82-
83-
1. Place breakpoints or `debugger` statements in the test or the underlying code wherever you'd like `jest` to pause.
84-
2. Open the file containing the test in question, and make sure its tab is active (so you can see the file's contents).
85-
3. Switch to the debugger in the sidebar and choose `Debug unit tests - just open file` from the dropdown.
86-
4. Click the green "play" button to run the tests in the open file in watch mode.
87-
88-
Pro tip: If any of your breakpoints are in code run by multiple tests, and you run the whole test file, you'll land on
89-
those breakpoints over and over again, in the middle of tests you don't care about. To avoid this, replace the test's
90-
initial `it` or `test` with `it.only` or `test.only`. That way, when you hit a breakpoint, you'll know you got there are
91-
part of the buggy test.
92-
9376
## Debug Build Flags
9477

9578
Throughout the codebase, you will find a `__DEBUG_BUILD__` constant. This flag serves two purposes:

dev-packages/e2e-tests/test-applications/nuxt-3/server/plugins/customNitroErrorHandler.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Context, GLOBAL_OBJ, dropUndefinedKeys, flush, logger, vercelWaitUntil } from '@sentry/core';
1+
import { Context, GLOBAL_OBJ, flush, logger, vercelWaitUntil } from '@sentry/core';
22
import * as SentryNode from '@sentry/node';
33
import { H3Error } from 'h3';
44
import type { CapturedErrorContext } from 'nitropack';
@@ -36,24 +36,22 @@ export default defineNitroPlugin(nitroApp => {
3636
});
3737

3838
function extractErrorContext(errorContext: CapturedErrorContext): Context {
39-
const structuredContext: Context = {
40-
method: undefined,
41-
path: undefined,
42-
tags: undefined,
43-
};
39+
const ctx: Context = {};
4440

45-
if (errorContext) {
46-
if (errorContext.event) {
47-
structuredContext.method = errorContext.event._method || undefined;
48-
structuredContext.path = errorContext.event._path || undefined;
49-
}
41+
if (!errorContext) {
42+
return ctx;
43+
}
5044

51-
if (Array.isArray(errorContext.tags)) {
52-
structuredContext.tags = errorContext.tags || undefined;
53-
}
45+
if (errorContext.event) {
46+
ctx.method = errorContext.event._method;
47+
ctx.path = errorContext.event._path;
48+
}
49+
50+
if (Array.isArray(errorContext.tags)) {
51+
ctx.tags = errorContext.tags;
5452
}
5553

56-
return dropUndefinedKeys(structuredContext);
54+
return ctx;
5755
}
5856

5957
async function flushIfServerless(): Promise<void> {

dev-packages/node-integration-tests/.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module.exports = {
22
env: {
33
node: true,
4-
jest: true,
54
},
65
extends: ['../../.eslintrc.js'],
76
overrides: [

dev-packages/node-integration-tests/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ folders containing test scenarios and assertions.
2323
`runServer` also accepts an optional `scenarioPath` argument for non-standard usage.
2424

2525
`test.ts` is required for each test case, and contains the server runner logic, request interceptors for Sentry
26-
requests, and assertions. Test server, interceptors and assertions are all run on the same Jest thread.
26+
requests, and assertions. Test server, interceptors and assertions are all run on the same Vitest thread.
2727

2828
### Utilities
2929

@@ -40,12 +40,10 @@ Tests can be run locally with:
4040

4141
`yarn test`
4242

43-
To run tests with Jest's watch mode:
43+
To run tests with Vitest's watch mode:
4444

4545
`yarn test:watch`
4646

4747
To filter tests by their title:
4848

4949
`yarn test -t "set different properties of a scope"`
50-
51-
You can refer to [Jest documentation](https://jestjs.io/docs/cli) for other CLI options.

dev-packages/node-integration-tests/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"lib": ["DOM", "ES2018"],
1010
// package-specific options
1111
"esModuleInterop": true,
12-
"types": ["node", "jest"]
12+
"types": ["node"]
1313
}
1414
}

jest/jest.config.js

Lines changed: 0 additions & 43 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"circularDepCheck": "lerna run circularDepCheck",
1616
"clean": "run-s clean:build clean:caches",
1717
"clean:build": "lerna run clean",
18-
"clean:caches": "yarn rimraf eslintcache .nxcache .nx && yarn jest --clearCache",
18+
"clean:caches": "yarn rimraf eslintcache .nxcache .nx",
1919
"clean:deps": "lerna clean --yes && rm -rf node_modules && yarn",
2020
"clean:tarballs": "rimraf {packages,dev-packages}/*/*.tgz",
2121
"clean:watchman": "watchman watch-del \".\"",
@@ -110,17 +110,13 @@
110110
"@rollup/pluginutils": "^5.1.0",
111111
"@size-limit/file": "~11.1.6",
112112
"@size-limit/webpack": "~11.1.6",
113-
"@types/jest": "^27.4.1",
114113
"@types/jsdom": "^21.1.6",
115114
"@types/node": "^18.19.1",
116115
"@vitest/coverage-v8": "^2.1.8",
117116
"deepmerge": "^4.2.2",
118117
"downlevel-dts": "~0.11.0",
119118
"es-check": "^7.2.1",
120119
"eslint": "7.32.0",
121-
"jest": "^27.5.1",
122-
"jest-environment-node": "^27.5.1",
123-
"jest-junit": "^16.0.0",
124120
"jsdom": "^21.1.2",
125121
"lerna": "7.1.1",
126122
"madge": "7.0.0",
@@ -133,7 +129,6 @@
133129
"rollup-plugin-license": "^3.3.1",
134130
"size-limit": "~11.1.6",
135131
"sucrase": "^3.35.0",
136-
"ts-jest": "^27.1.4",
137132
"ts-node": "10.9.1",
138133
"typescript": "~5.0.0",
139134
"vitest": "^2.1.8",

0 commit comments

Comments
 (0)