Skip to content

Commit dec31e3

Browse files
committed
Remove local jest version, use global.
1 parent e28dcd9 commit dec31e3

File tree

3 files changed

+107
-1122
lines changed

3 files changed

+107
-1122
lines changed

packages/node-integration-tests/package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "@sentry-internal/node-integration-tests",
33
"version": "6.17.9",
4-
"main": "index.js",
54
"license": "MIT",
65
"engines": {
76
"node": ">=10"
@@ -19,12 +18,9 @@
1918
"dependencies": {
2019
"@babel/core": "^7.17.5",
2120
"@babel/plugin-transform-modules-commonjs": "^7.16.8",
22-
"babel-jest": "^27.5.1",
21+
"babel-jest": "^24.9.0",
2322
"express": "^4.17.3",
24-
"jest": "^27.5.1",
25-
"jest-environment-node": "^27.5.1",
2623
"nock": "^13.1.0",
27-
"portfinder": "^1.0.28",
28-
"ts-jest": "^27.1.3"
24+
"portfinder": "^1.0.28"
2925
}
3026
}

packages/node-integration-tests/suites/send-event/capture-exception/__snapshots__/test.ts.snap

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Object {
143143
"filename": "/Users/onurtemizkan/Projects/sentry-javascript/packages/node-integration-tests/utils/index.ts",
144144
"function": "Object.<anonymous>",
145145
"in_app": true,
146-
"lineno": 76,
146+
"lineno": 79,
147147
"module": "index.ts",
148148
"post_context": Array [
149149
"",
@@ -155,9 +155,9 @@ Object {
155155
" });",
156156
],
157157
"pre_context": Array [
158-
" const url = \`http://localhost:\${port}/test\`;",
159158
"",
160159
" await new Promise(resolve => {",
160+
" // eslint-disable-next-line @typescript-eslint/no-var-requires",
161161
" const app = require(\`\${testDir}/server\`).default as Express;",
162162
"",
163163
" app.get('/test', async () => {",
@@ -170,52 +170,52 @@ Object {
170170
"filename": "/Users/onurtemizkan/Projects/sentry-javascript/node_modules/jest-runtime/build/index.js",
171171
"function": "Runtime.requireModuleOrMock",
172172
"in_app": false,
173-
"lineno": 1210,
173+
"lineno": 598,
174174
"module": "jest-runtime.build:index",
175175
"post_context": Array [
176176
" }",
177177
" } catch (e) {",
178-
" const moduleNotFound =",
179-
" _jestResolve().default.tryCastModuleNotFoundError(e);",
180-
"",
181-
" if (moduleNotFound) {",
182-
" if (",
178+
" if (e.code === 'MODULE_NOT_FOUND') {",
179+
" const appendedMessage = (0, _helpers.findSiblingsWithFileExtension)(",
180+
" this._config.moduleFileExtensions,",
181+
" from,",
182+
" moduleName",
183183
],
184184
"pre_context": Array [
185-
" if (",
186-
" this._shouldMock(from, moduleName, this._explicitShouldMock, {",
187-
" conditions: this.cjsConditions",
188-
" })",
189-
" ) {",
185+
" }",
186+
"",
187+
" requireModuleOrMock(from, moduleName) {",
188+
" try {",
189+
" if (this._shouldMock(from, moduleName)) {",
190190
" return this.requireMock(from, moduleName);",
191191
" } else {",
192192
],
193193
},
194194
Object {
195-
"colno": 12,
196-
"context_line": " this._loadModule(",
195+
"colno": 10,
196+
"context_line": " this._loadModule(",
197197
"filename": "/Users/onurtemizkan/Projects/sentry-javascript/node_modules/jest-runtime/build/index.js",
198198
"function": "Runtime.requireModule",
199199
"in_app": false,
200-
"lineno": 1009,
200+
"lineno": 433,
201201
"module": "jest-runtime.build:index",
202202
"post_context": Array [
203-
" localModule,",
204-
" from,",
205-
" moduleName,",
206-
" modulePath,",
207-
" options,",
208-
" moduleRegistry",
209-
" );",
203+
" localModule,",
204+
" from,",
205+
" moduleName,",
206+
" modulePath,",
207+
" options,",
208+
" moduleRegistry",
209+
" );",
210210
],
211211
"pre_context": Array [
212+
" exports: {},",
213+
" filename: modulePath,",
212214
" id: modulePath,",
213-
" loaded: false,",
214-
" path: path().dirname(modulePath)",
215+
" loaded: false",
215216
" };",
216217
" moduleRegistry.set(modulePath, localModule);",
217218
"",
218-
" try {",
219219
],
220220
},
221221
Object {
@@ -224,20 +224,20 @@ Object {
224224
"filename": "/Users/onurtemizkan/Projects/sentry-javascript/node_modules/jest-runtime/build/index.js",
225225
"function": "Runtime._loadModule",
226226
"in_app": false,
227-
"lineno": 1185,
227+
"lineno": 577,
228228
"module": "jest-runtime.build:index",
229229
"post_context": Array [
230230
" }",
231231
"",
232232
" localModule.loaded = true;",
233233
" }",
234234
"",
235-
" _getFullTransformationOptions(options = defaultTransformOptions) {",
236-
" return {...options, ...this._coverageOptions};",
235+
" _getFullTransformationOptions(options) {",
236+
" return _objectSpread({}, options, {",
237237
],
238238
"pre_context": Array [
239-
" this._environment.global.JSON.parse(transformedFile);",
240-
" } else if (path().extname(modulePath) === '.node') {",
239+
" );",
240+
" } else if (_path().default.extname(modulePath) === '.node') {",
241241
" localModule.exports = require(modulePath);",
242242
" } else {",
243243
" // Only include the fromPath if a moduleName is given. Else treat as root.",
@@ -246,30 +246,30 @@ Object {
246246
],
247247
},
248248
Object {
249-
"colno": 24,
250-
"context_line": " compiledFunction.call(",
249+
"colno": 68,
250+
"context_line": " runScript[_transform().ScriptTransformer.EVAL_RESULT_VARIABLE].call(",
251251
"filename": "/Users/onurtemizkan/Projects/sentry-javascript/node_modules/jest-runtime/build/index.js",
252252
"function": "Runtime._execModule",
253253
"in_app": false,
254-
"lineno": 1646,
254+
"lineno": 867,
255255
"module": "jest-runtime.build:index",
256256
"post_context": Array [
257-
" module.exports,",
258-
" module, // module object",
259-
" module.exports, // module exports",
260-
" module.require, // require implementation",
261-
" module.path, // __dirname",
262-
" module.filename, // __filename",
263-
" // @ts-expect-error",
257+
" localModule.exports,",
258+
" localModule, // module object",
259+
" localModule.exports, // module exports",
260+
" localModule.require, // require implementation",
261+
" dirname, // __dirname",
262+
" filename, // __filename",
263+
" this._environment.global, // global object",
264264
],
265265
"pre_context": Array [
266+
" 'You are trying to \`import\` a file after the Jest environment has been torn down.'",
267+
" );",
266268
"",
267-
" Object.defineProperty(module, 'main', {",
268-
" enumerable: true,",
269-
" value: this._mainModule",
270-
" });",
269+
" process.exitCode = 1;",
270+
" return;",
271+
" } //Wrapper",
271272
"",
272-
" try {",
273273
],
274274
},
275275
Object {

0 commit comments

Comments
 (0)