@sentry/wizard 3.34.2 → 3.34.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/e2e-tests/jest.config.d.ts +1 -0
  3. package/dist/e2e-tests/jest.config.js +5 -0
  4. package/dist/e2e-tests/jest.config.js.map +1 -1
  5. package/dist/e2e-tests/tests/nextjs.test.d.ts +1 -0
  6. package/dist/e2e-tests/tests/nextjs.test.js +221 -0
  7. package/dist/e2e-tests/tests/nextjs.test.js.map +1 -0
  8. package/dist/e2e-tests/tests/remix.test.js +47 -43
  9. package/dist/e2e-tests/tests/remix.test.js.map +1 -1
  10. package/dist/e2e-tests/tests/sveltekit.test.d.ts +1 -0
  11. package/dist/e2e-tests/tests/sveltekit.test.js +186 -0
  12. package/dist/e2e-tests/tests/sveltekit.test.js.map +1 -0
  13. package/dist/e2e-tests/utils/index.d.ts +13 -2
  14. package/dist/e2e-tests/utils/index.js +45 -13
  15. package/dist/e2e-tests/utils/index.js.map +1 -1
  16. package/dist/package.json +3 -5
  17. package/dist/src/apple/templates.d.ts +1 -1
  18. package/dist/src/apple/templates.js +6 -2
  19. package/dist/src/apple/templates.js.map +1 -1
  20. package/dist/src/apple/xcode-manager.js +2 -1
  21. package/dist/src/apple/xcode-manager.js.map +1 -1
  22. package/dist/src/nextjs/nextjs-wizard.js +68 -47
  23. package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
  24. package/dist/src/nextjs/templates.d.ts +1 -0
  25. package/dist/src/nextjs/templates.js +5 -1
  26. package/dist/src/nextjs/templates.js.map +1 -1
  27. package/e2e-tests/.env.example +11 -0
  28. package/e2e-tests/jest.config.ts +8 -1
  29. package/e2e-tests/package.json +14 -0
  30. package/e2e-tests/run.sh +15 -0
  31. package/e2e-tests/test-applications/nextjs-test-app/next.config.mjs +4 -0
  32. package/e2e-tests/test-applications/nextjs-test-app/package.json +22 -0
  33. package/e2e-tests/test-applications/nextjs-test-app/src/app/layout.tsx +20 -0
  34. package/e2e-tests/test-applications/nextjs-test-app/src/app/page.tsx +90 -0
  35. package/e2e-tests/test-applications/sveltekit-test-app/package.json +21 -0
  36. package/e2e-tests/test-applications/sveltekit-test-app/src/app.d.ts +13 -0
  37. package/e2e-tests/test-applications/sveltekit-test-app/src/app.html +11 -0
  38. package/e2e-tests/test-applications/sveltekit-test-app/src/lib/index.ts +1 -0
  39. package/e2e-tests/test-applications/sveltekit-test-app/src/routes/+page.svelte +2 -0
  40. package/e2e-tests/test-applications/sveltekit-test-app/svelte.config.js +18 -0
  41. package/e2e-tests/test-applications/sveltekit-test-app/vite.config.ts +6 -0
  42. package/e2e-tests/tests/nextjs.test.ts +161 -0
  43. package/e2e-tests/tests/remix.test.ts +35 -44
  44. package/e2e-tests/tests/sveltekit.test.ts +154 -0
  45. package/e2e-tests/utils/index.ts +54 -11
  46. package/package.json +3 -5
  47. package/src/apple/templates.ts +5 -1
  48. package/src/apple/xcode-manager.ts +2 -0
  49. package/src/nextjs/nextjs-wizard.ts +31 -6
  50. package/src/nextjs/templates.ts +15 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.34.3
4
+
5
+ - fix(Apple): Sentry-cli not found by build phase when installed with homebrew (#691)
6
+ - feat(nextjs): Create `next.config.mjs` when package.json has type: "module" (#699)
7
+
3
8
  ## 3.34.2
4
9
 
5
10
  - fix(nextjs): Don't ask for package manager twice (#690)
@@ -11,5 +11,6 @@ declare const _default: {
11
11
  tsconfig: string;
12
12
  };
13
13
  };
14
+ verbose: boolean;
14
15
  };
15
16
  export default _default;
@@ -1,5 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ var dotenv_1 = require("dotenv");
4
+ (0, dotenv_1.config)({
5
+ path: '.env',
6
+ });
3
7
  exports.default = {
4
8
  testTimeout: 360000,
5
9
  testEnvironment: 'node',
@@ -13,5 +17,6 @@ exports.default = {
13
17
  tsconfig: 'tsconfig.json',
14
18
  },
15
19
  },
20
+ verbose: true,
16
21
  };
17
22
  //# sourceMappingURL=jest.config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"jest.config.js","sourceRoot":"","sources":["../../e2e-tests/jest.config.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACb,WAAW,EAAE,MAAM;IACnB,eAAe,EAAE,MAAM;IACvB,SAAS,EAAE,CAAC,cAAc,CAAC;IAC3B,SAAS,EAAE;QACT,aAAa,EAAE,SAAS;KACzB;IACD,oBAAoB,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;IAChE,OAAO,EAAE;QACP,SAAS,EAAE;YACT,QAAQ,EAAE,eAAe;SAC1B;KACF;CACF,CAAA","sourcesContent":["export default {\n testTimeout: 360000,\n testEnvironment: 'node',\n testMatch: ['**/*.test.ts'],\n transform: {\n '^.+\\\\.tsx?$': 'ts-jest',\n },\n moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],\n globals: {\n 'ts-jest': {\n tsconfig: 'tsconfig.json',\n },\n },\n}"]}
1
+ {"version":3,"file":"jest.config.js","sourceRoot":"","sources":["../../e2e-tests/jest.config.ts"],"names":[],"mappings":";;AAAA,iCAAgC;AAEhC,IAAA,eAAM,EAAC;IACL,IAAI,EAAE,MAAM;CACb,CAAC,CAAC;AAEH,kBAAe;IACb,WAAW,EAAE,MAAM;IACnB,eAAe,EAAE,MAAM;IACvB,SAAS,EAAE,CAAC,cAAc,CAAC;IAC3B,SAAS,EAAE;QACT,aAAa,EAAE,SAAS;KACzB;IACD,oBAAoB,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;IAChE,OAAO,EAAE;QACP,SAAS,EAAE;YACT,QAAQ,EAAE,eAAe;SAC1B;KACF;IACD,OAAO,EAAE,IAAI;CACd,CAAC","sourcesContent":["import { config } from 'dotenv';\n\nconfig({\n path: '.env',\n});\n\nexport default {\n testTimeout: 360000,\n testEnvironment: 'node',\n testMatch: ['**/*.test.ts'],\n transform: {\n '^.+\\\\.tsx?$': 'ts-jest',\n },\n moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],\n globals: {\n 'ts-jest': {\n tsconfig: 'tsconfig.json',\n },\n },\n verbose: true,\n};\n"]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,221 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ var __generator = (this && this.__generator) || function (thisArg, body) {
35
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
36
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
+ function verb(n) { return function (v) { return step([n, v]); }; }
38
+ function step(op) {
39
+ if (f) throw new TypeError("Generator is already executing.");
40
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
42
+ if (y = 0, t) op = [op[0] & 2, t.value];
43
+ switch (op[0]) {
44
+ case 0: case 1: t = op; break;
45
+ case 4: _.label++; return { value: op[1], done: false };
46
+ case 5: _.label++; y = op[1]; op = [0]; continue;
47
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
48
+ default:
49
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
50
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
51
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
52
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
53
+ if (t[2]) _.ops.pop();
54
+ _.trys.pop(); continue;
55
+ }
56
+ op = body.call(thisArg, _);
57
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
58
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
+ }
60
+ };
61
+ Object.defineProperty(exports, "__esModule", { value: true });
62
+ /* eslint-disable jest/expect-expect */
63
+ var Constants_1 = require("../../lib/Constants");
64
+ var utils_1 = require("../utils");
65
+ var utils_2 = require("../utils");
66
+ var utils_3 = require("../utils");
67
+ var path = __importStar(require("path"));
68
+ describe('NextJS', function () {
69
+ var integration = Constants_1.Integration.nextjs;
70
+ var projectDir = path.resolve(__dirname, '../test-applications/nextjs-test-app');
71
+ beforeAll(function () { return __awaiter(void 0, void 0, void 0, function () {
72
+ var wizardInstance, packageManagerPrompted, routeThroughNextJsPrompted, _a, reactComponentAnnotationsPrompted, _b, tracingOptionPrompted, _c, replayOptionPrompted, _d, examplePagePrompted, _e, ciCdPrompted, _f, _g;
73
+ return __generator(this, function (_h) {
74
+ switch (_h.label) {
75
+ case 0:
76
+ wizardInstance = (0, utils_2.startWizardInstance)(integration, projectDir);
77
+ return [4 /*yield*/, wizardInstance.waitForOutput('Please select your package manager.')];
78
+ case 1:
79
+ packageManagerPrompted = _h.sent();
80
+ _a = packageManagerPrompted;
81
+ if (!_a) return [3 /*break*/, 3];
82
+ return [4 /*yield*/, wizardInstance.sendStdinAndWaitForOutput(
83
+ // Selecting `yarn` as the package manager
84
+ [utils_1.KEYS.DOWN, utils_1.KEYS.ENTER], 'Do you want to route Sentry requests in the browser through your Next.js server', {
85
+ timeout: 240000,
86
+ })];
87
+ case 2:
88
+ _a = (_h.sent());
89
+ _h.label = 3;
90
+ case 3:
91
+ routeThroughNextJsPrompted = _a;
92
+ _b = routeThroughNextJsPrompted;
93
+ if (!_b) return [3 /*break*/, 5];
94
+ return [4 /*yield*/, wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.ENTER], 'Do you want to enable React component annotations')];
95
+ case 4:
96
+ _b = (_h.sent());
97
+ _h.label = 5;
98
+ case 5:
99
+ reactComponentAnnotationsPrompted = _b;
100
+ _c = reactComponentAnnotationsPrompted;
101
+ if (!_c) return [3 /*break*/, 7];
102
+ return [4 /*yield*/, wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.ENTER],
103
+ // "Do you want to enable Tracing", sometimes doesn't work as `Tracing` can be printed in bold.
104
+ 'to track the performance of your application?')];
105
+ case 6:
106
+ _c = (_h.sent());
107
+ _h.label = 7;
108
+ case 7:
109
+ tracingOptionPrompted = _c;
110
+ _d = tracingOptionPrompted;
111
+ if (!_d) return [3 /*break*/, 9];
112
+ return [4 /*yield*/, wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.ENTER],
113
+ // "Do you want to enable Sentry Session Replay", sometimes doesn't work as `Sentry Session Replay` can be printed in bold.
114
+ 'to get a video-like reproduction of errors during a user session?')];
115
+ case 8:
116
+ _d = (_h.sent());
117
+ _h.label = 9;
118
+ case 9:
119
+ replayOptionPrompted = _d;
120
+ _e = replayOptionPrompted;
121
+ if (!_e) return [3 /*break*/, 11];
122
+ return [4 /*yield*/, wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.ENTER], 'Do you want to create an example page', {
123
+ optional: true,
124
+ })];
125
+ case 10:
126
+ _e = (_h.sent());
127
+ _h.label = 11;
128
+ case 11:
129
+ examplePagePrompted = _e;
130
+ _f = examplePagePrompted;
131
+ if (!_f) return [3 /*break*/, 13];
132
+ return [4 /*yield*/, wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.ENTER], 'Are you using a CI/CD tool')];
133
+ case 12:
134
+ _f = (_h.sent());
135
+ _h.label = 13;
136
+ case 13:
137
+ ciCdPrompted = _f;
138
+ _g = ciCdPrompted;
139
+ if (!_g) return [3 /*break*/, 15];
140
+ return [4 /*yield*/, wizardInstance.sendStdinAndWaitForOutput(
141
+ // Selecting `No` for CI/CD tool
142
+ [utils_1.KEYS.DOWN, utils_1.KEYS.ENTER], 'Successfully installed the Sentry Next.js SDK!')];
143
+ case 14:
144
+ _g = (_h.sent());
145
+ _h.label = 15;
146
+ case 15:
147
+ _g;
148
+ wizardInstance.kill();
149
+ return [2 /*return*/];
150
+ }
151
+ });
152
+ }); });
153
+ afterAll(function () {
154
+ (0, utils_1.revertLocalChanges)(projectDir);
155
+ (0, utils_1.cleanupGit)(projectDir);
156
+ });
157
+ test('package.json is updated correctly', function () {
158
+ (0, utils_3.checkPackageJson)(projectDir, integration);
159
+ });
160
+ test('.env-sentry-build-plugin is created and contains the auth token', function () {
161
+ (0, utils_1.checkEnvBuildPlugin)(projectDir);
162
+ });
163
+ test('example page exists', function () {
164
+ (0, utils_3.checkFileExists)("".concat(projectDir, "/src/app/sentry-example-page/page.tsx"));
165
+ (0, utils_3.checkFileExists)("".concat(projectDir, "/src/app/api/sentry-example-api/route.ts"));
166
+ });
167
+ test('config files created', function () {
168
+ (0, utils_3.checkFileExists)("".concat(projectDir, "/sentry.server.config.ts"));
169
+ (0, utils_3.checkFileExists)("".concat(projectDir, "/sentry.client.config.ts"));
170
+ (0, utils_3.checkFileExists)("".concat(projectDir, "/sentry.edge.config.ts"));
171
+ });
172
+ test('global error file exists', function () {
173
+ (0, utils_3.checkFileExists)("".concat(projectDir, "/src/app/global-error.tsx"));
174
+ });
175
+ test('instrumentation file exists', function () {
176
+ (0, utils_3.checkFileExists)("".concat(projectDir, "/src/instrumentation.ts"));
177
+ });
178
+ test('instrumentation file contains Sentry initialization', function () {
179
+ (0, utils_3.checkFileContents)("".concat(projectDir, "/src/instrumentation.ts"), [
180
+ "import * as Sentry from '@sentry/nextjs';",
181
+ "export async function register() {\n if (process.env.NEXT_RUNTIME === 'nodejs') {\n await import('../sentry.server.config');\n }\n\n if (process.env.NEXT_RUNTIME === 'edge') {\n await import('../sentry.edge.config');\n }\n}\n\nexport const onRequestError = Sentry.captureRequestError;",
182
+ ]);
183
+ });
184
+ test('next.config file contains Sentry wrapper', function () {
185
+ (0, utils_3.checkFileContents)("".concat(projectDir, "/next.config.mjs"), [
186
+ "import {withSentryConfig} from '@sentry/nextjs'",
187
+ 'export default withSentryConfig(nextConfig, {',
188
+ ]);
189
+ });
190
+ test('runs on dev mode correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
191
+ return __generator(this, function (_a) {
192
+ switch (_a.label) {
193
+ case 0: return [4 /*yield*/, (0, utils_3.checkIfRunsOnDevMode)(projectDir, 'Ready in')];
194
+ case 1:
195
+ _a.sent();
196
+ return [2 /*return*/];
197
+ }
198
+ });
199
+ }); });
200
+ test('builds correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
201
+ return __generator(this, function (_a) {
202
+ switch (_a.label) {
203
+ case 0: return [4 /*yield*/, (0, utils_3.checkIfBuilds)(projectDir, 'server-rendered on demand')];
204
+ case 1:
205
+ _a.sent();
206
+ return [2 /*return*/];
207
+ }
208
+ });
209
+ }); });
210
+ test('runs on prod mode correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
211
+ return __generator(this, function (_a) {
212
+ switch (_a.label) {
213
+ case 0: return [4 /*yield*/, (0, utils_3.checkIfRunsOnProdMode)(projectDir, 'Ready in')];
214
+ case 1:
215
+ _a.sent();
216
+ return [2 /*return*/];
217
+ }
218
+ });
219
+ }); });
220
+ });
221
+ //# sourceMappingURL=nextjs.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nextjs.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/nextjs.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,iDAAkD;AAClD,kCAKkB;AAClB,kCAA+C;AAC/C,kCAOkB;AAClB,yCAA6B;AAE7B,QAAQ,CAAC,QAAQ,EAAE;IACjB,IAAM,WAAW,GAAG,uBAAW,CAAC,MAAM,CAAC;IACvC,IAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAC7B,SAAS,EACT,sCAAsC,CACvC,CAAC;IAEF,SAAS,CAAC;;;;;oBACF,cAAc,GAAG,IAAA,2BAAmB,EAAC,WAAW,EAAE,UAAU,CAAC,CAAC;oBACrC,qBAAM,cAAc,CAAC,aAAa,CAC/D,qCAAqC,CACtC,EAAA;;oBAFK,sBAAsB,GAAG,SAE9B;oBAGC,KAAA,sBAAsB,CAAA;6BAAtB,wBAAsB;oBACrB,q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AC5D,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,6BAA6B,EAAE;QAClC,IAAA,uBAAe,EAAC,UAAG,UAAU,4BAAyB,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,qDAAqD,EAAE;QAC1D,IAAA,yBAAiB,EAAC,UAAG,UAAU,4BAAyB,EAAE;YACxD,2CAA2C;YAC3C,wSAUoD;SACrD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,0CAA0C,EAAE;QAC/C,IAAA,yBAAiB,EAAC,UAAG,UAAU,qBAAkB,EAAE;YACjD,iDAAiD;YACjD,+CAA+C;SAChD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,4BAA4B,EAAE;;;wBACjC,qBAAM,IAAA,4BAAoB,EAAC,UAAU,EAAE,UAAU,CAAC,EAAA;;oBAAlD,SAAkD,CAAC;;;;SACpD,CAAC,CAAC;IAEH,IAAI,CAAC,kBAAkB,EAAE;;;wBACvB,qBAAM,IAAA,qBAAa,EAAC,UAAU,EAAE,2BAA2B,CAAC,EAAA;;oBAA5D,SAA4D,CAAC;;;;SAC9D,CAAC,CAAC;IAEH,IAAI,CAAC,6BAA6B,EAAE;;;wBAClC,qBAAM,IAAA,6BAAqB,EAAC,UAAU,EAAE,UAAU,CAAC,EAAA;;oBAAnD,SAAmD,CAAC;;;;SACrD,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable jest/expect-expect */\nimport { Integration } from '../../lib/Constants';\nimport {\n checkEnvBuildPlugin,\n cleanupGit,\n KEYS,\n revertLocalChanges,\n} from '../utils';\nimport { startWizardInstance } from '../utils';\nimport {\n checkFileContents,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnDevMode,\n checkIfRunsOnProdMode,\n checkPackageJson,\n} from '../utils';\nimport * as path from 'path';\n\ndescribe('NextJS', () => {\n const integration = Integration.nextjs;\n const projectDir = path.resolve(\n __dirname,\n '../test-applications/nextjs-test-app',\n );\n\n beforeAll(async () => {\n const wizardInstance = startWizardInstance(integration, projectDir);\n const packageManagerPrompted = await wizardInstance.waitForOutput(\n 'Please select your package manager.',\n );\n\n const routeThroughNextJsPrompted =\n packageManagerPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Selecting `yarn` as the package manager\n [KEYS.DOWN, KEYS.ENTER],\n 'Do you want to route Sentry requests in the browser through your Next.js server',\n {\n timeout: 240_000,\n },\n ));\n\n const reactComponentAnnotationsPrompted =\n routeThroughNextJsPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Do you want to enable React component annotations',\n ));\n\n const tracingOptionPrompted =\n reactComponentAnnotationsPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n // \"Do you want to enable Tracing\", sometimes doesn't work as `Tracing` can be printed in bold.\n 'to track the performance of your application?',\n ));\n\n const replayOptionPrompted =\n tracingOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n // \"Do you want to enable Sentry Session Replay\", sometimes doesn't work as `Sentry Session Replay` can be printed in bold.\n 'to get a video-like reproduction of errors during a user session?',\n ));\n\n const examplePagePrompted =\n replayOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Do you want to create an example page',\n {\n optional: true,\n },\n ));\n\n const ciCdPrompted =\n examplePagePrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Are you using a CI/CD tool',\n ));\n\n ciCdPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Selecting `No` for CI/CD tool\n [KEYS.DOWN, KEYS.ENTER],\n 'Successfully installed the Sentry Next.js SDK!',\n ));\n\n wizardInstance.kill();\n });\n\n afterAll(() => {\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n });\n\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, integration);\n });\n\n test('.env-sentry-build-plugin is created and contains the auth token', () => {\n checkEnvBuildPlugin(projectDir);\n });\n\n test('example page exists', () => {\n checkFileExists(`${projectDir}/src/app/sentry-example-page/page.tsx`);\n checkFileExists(`${projectDir}/src/app/api/sentry-example-api/route.ts`);\n });\n\n test('config files created', () => {\n checkFileExists(`${projectDir}/sentry.server.config.ts`);\n checkFileExists(`${projectDir}/sentry.client.config.ts`);\n checkFileExists(`${projectDir}/sentry.edge.config.ts`);\n });\n\n test('global error file exists', () => {\n checkFileExists(`${projectDir}/src/app/global-error.tsx`);\n });\n\n test('instrumentation file exists', () => {\n checkFileExists(`${projectDir}/src/instrumentation.ts`);\n });\n\n test('instrumentation file contains Sentry initialization', () => {\n checkFileContents(`${projectDir}/src/instrumentation.ts`, [\n \"import * as Sentry from '@sentry/nextjs';\",\n `export async function register() {\n if (process.env.NEXT_RUNTIME === 'nodejs') {\n await import('../sentry.server.config');\n }\n\n if (process.env.NEXT_RUNTIME === 'edge') {\n await import('../sentry.edge.config');\n }\n}\n\nexport const onRequestError = Sentry.captureRequestError;`,\n ]);\n });\n\n test('next.config file contains Sentry wrapper', () => {\n checkFileContents(`${projectDir}/next.config.mjs`, [\n \"import {withSentryConfig} from '@sentry/nextjs'\",\n 'export default withSentryConfig(nextConfig, {',\n ]);\n });\n\n test('runs on dev mode correctly', async () => {\n await checkIfRunsOnDevMode(projectDir, 'Ready in');\n });\n\n test('builds correctly', async () => {\n await checkIfBuilds(projectDir, 'server-rendered on demand');\n });\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(projectDir, 'Ready in');\n });\n});\n"]}
@@ -62,52 +62,56 @@ Object.defineProperty(exports, "__esModule", { value: true });
62
62
  /* eslint-disable jest/expect-expect */
63
63
  var Constants_1 = require("../../lib/Constants");
64
64
  var utils_1 = require("../utils");
65
- var utils_2 = require("../utils");
66
- var utils_3 = require("../utils");
67
65
  var path = __importStar(require("path"));
68
66
  describe('Remix', function () {
69
67
  var integration = Constants_1.Integration.remix;
70
68
  var projectDir = path.resolve(__dirname, '../test-applications/remix-test-app');
71
69
  beforeAll(function () { return __awaiter(void 0, void 0, void 0, function () {
72
- var wizardInstance, packageManagerPrompted, tracingOptionPrompted, replayOptionPrompted, examplePagePrompted;
73
- return __generator(this, function (_a) {
74
- switch (_a.label) {
70
+ var wizardInstance, packageManagerPrompted, tracingOptionPrompted, _a, replayOptionPrompted, _b, _c;
71
+ return __generator(this, function (_d) {
72
+ switch (_d.label) {
75
73
  case 0:
76
- wizardInstance = (0, utils_2.startWizardInstance)(integration, projectDir);
74
+ wizardInstance = (0, utils_1.startWizardInstance)(integration, projectDir);
77
75
  return [4 /*yield*/, wizardInstance.waitForOutput('Please select your package manager.')];
78
76
  case 1:
79
- packageManagerPrompted = _a.sent();
80
- if (packageManagerPrompted) {
77
+ packageManagerPrompted = _d.sent();
78
+ _a = packageManagerPrompted;
79
+ if (!_a) return [3 /*break*/, 3];
80
+ return [4 /*yield*/, wizardInstance.sendStdinAndWaitForOutput(
81
81
  // Selecting `yarn` as the package manager
82
- wizardInstance.sendStdin(utils_1.KEYS.DOWN);
83
- wizardInstance.sendStdin(utils_1.KEYS.ENTER);
84
- }
85
- return [4 /*yield*/, wizardInstance.waitForOutput('Do you want to enable Tracing', {
82
+ [utils_1.KEYS.DOWN, utils_1.KEYS.ENTER],
83
+ // "Do you want to enable Tracing", sometimes doesn't work as `Tracing` can be printed in bold.
84
+ 'to track the performance of your application?', {
86
85
  timeout: 240000,
87
86
  })];
88
87
  case 2:
89
- tracingOptionPrompted = _a.sent();
90
- if (tracingOptionPrompted) {
91
- wizardInstance.sendStdin(utils_1.KEYS.ENTER);
92
- }
93
- return [4 /*yield*/, wizardInstance.waitForOutput('Do you want to enable Sentry Session Replay')];
88
+ _a = (_d.sent());
89
+ _d.label = 3;
94
90
  case 3:
95
- replayOptionPrompted = _a.sent();
96
- if (replayOptionPrompted) {
97
- wizardInstance.sendStdin(utils_1.KEYS.ENTER);
98
- }
99
- return [4 /*yield*/, wizardInstance.waitForOutput('Do you want to create an example page', {
100
- optional: true,
101
- })];
91
+ tracingOptionPrompted = _a;
92
+ _b = tracingOptionPrompted;
93
+ if (!_b) return [3 /*break*/, 5];
94
+ return [4 /*yield*/, wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.ENTER],
95
+ // "Do you want to enable Sentry Session Replay", sometimes doesn't work as `Sentry Session Replay` can be printed in bold.
96
+ 'to get a video-like reproduction of errors during a user session?')];
102
97
  case 4:
103
- examplePagePrompted = _a.sent();
104
- if (examplePagePrompted) {
105
- wizardInstance.sendStdin(utils_1.KEYS.ENTER);
106
- wizardInstance.sendStdin(utils_1.KEYS.ENTER);
107
- }
108
- return [4 /*yield*/, wizardInstance.waitForOutput('Sentry has been successfully configured for your Remix project')];
98
+ _b = (_d.sent());
99
+ _d.label = 5;
109
100
  case 5:
110
- _a.sent();
101
+ replayOptionPrompted = _b;
102
+ _c = replayOptionPrompted;
103
+ if (!_c) return [3 /*break*/, 7];
104
+ return [4 /*yield*/, wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.ENTER], 'Do you want to create an example page', {
105
+ optional: true,
106
+ })];
107
+ case 6:
108
+ _c = (_d.sent());
109
+ _d.label = 7;
110
+ case 7:
111
+ _c;
112
+ return [4 /*yield*/, wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.ENTER, utils_1.KEYS.ENTER], 'Sentry has been successfully configured for your Remix project')];
113
+ case 8:
114
+ _d.sent();
111
115
  wizardInstance.kill();
112
116
  return [2 /*return*/];
113
117
  }
@@ -118,37 +122,37 @@ describe('Remix', function () {
118
122
  (0, utils_1.cleanupGit)(projectDir);
119
123
  });
120
124
  test('package.json is updated correctly', function () {
121
- (0, utils_3.checkPackageJson)(projectDir, integration);
125
+ (0, utils_1.checkPackageJson)(projectDir, integration);
122
126
  });
123
127
  test('.env-sentry-build-plugin is created and contains the auth token', function () {
124
128
  (0, utils_1.checkEnvBuildPlugin)(projectDir);
125
129
  });
126
130
  test('example page exists', function () {
127
- (0, utils_3.checkFileExists)("".concat(projectDir, "/app/routes/sentry-example-page.tsx"));
131
+ (0, utils_1.checkFileExists)("".concat(projectDir, "/app/routes/sentry-example-page.tsx"));
128
132
  });
129
133
  test('instrumentation.server file exists', function () {
130
- (0, utils_3.checkFileExists)("".concat(projectDir, "/instrumentation.server.mjs"));
134
+ (0, utils_1.checkFileExists)("".concat(projectDir, "/instrumentation.server.mjs"));
131
135
  });
132
136
  test('entry.client file contains Sentry initialization', function () {
133
- (0, utils_3.checkFileContents)("".concat(projectDir, "/app/entry.client.tsx"), [
137
+ (0, utils_1.checkFileContents)("".concat(projectDir, "/app/entry.client.tsx"), [
134
138
  'import * as Sentry from "@sentry/remix";',
135
- "Sentry.init({\n dsn: \"".concat(utils_3.TEST_ARGS.PROJECT_DSN, "\",\n tracesSampleRate: 1,\n\n integrations: [Sentry.browserTracingIntegration({\n useEffect,\n useLocation,\n useMatches\n }), Sentry.replayIntegration({\n maskAllText: true,\n blockAllMedia: true\n })],\n\n replaysSessionSampleRate: 0.1,\n replaysOnErrorSampleRate: 1\n})"),
139
+ "Sentry.init({\n dsn: \"".concat(utils_1.TEST_ARGS.PROJECT_DSN, "\",\n tracesSampleRate: 1,\n\n integrations: [Sentry.browserTracingIntegration({\n useEffect,\n useLocation,\n useMatches\n }), Sentry.replayIntegration({\n maskAllText: true,\n blockAllMedia: true\n })],\n\n replaysSessionSampleRate: 0.1,\n replaysOnErrorSampleRate: 1\n})"),
136
140
  ]);
137
141
  });
138
142
  test('entry.server file contains Sentry code', function () {
139
- (0, utils_3.checkFileContents)("".concat(projectDir, "/app/entry.server.tsx"), [
143
+ (0, utils_1.checkFileContents)("".concat(projectDir, "/app/entry.server.tsx"), [
140
144
  'import * as Sentry from "@sentry/remix";',
141
145
  "export const handleError = Sentry.wrapHandleErrorWithSentry((error, { request }) => {\n // Custom handleError implementation\n});",
142
146
  ]);
143
147
  });
144
148
  test('instrumentation.server file contains Sentry initialization', function () {
145
- (0, utils_3.checkFileContents)("".concat(projectDir, "/instrumentation.server.mjs"), [
149
+ (0, utils_1.checkFileContents)("".concat(projectDir, "/instrumentation.server.mjs"), [
146
150
  'import * as Sentry from "@sentry/remix";',
147
- "Sentry.init({\n dsn: \"".concat(utils_3.TEST_ARGS.PROJECT_DSN, "\",\n tracesSampleRate: 1,\n autoInstrumentRemix: true\n})"),
151
+ "Sentry.init({\n dsn: \"".concat(utils_1.TEST_ARGS.PROJECT_DSN, "\",\n tracesSampleRate: 1,\n autoInstrumentRemix: true\n})"),
148
152
  ]);
149
153
  });
150
154
  test('root file contains Sentry ErrorBoundary', function () {
151
- (0, utils_3.checkFileContents)("".concat(projectDir, "/app/root.tsx"), [
155
+ (0, utils_1.checkFileContents)("".concat(projectDir, "/app/root.tsx"), [
152
156
  'import { captureRemixErrorBoundaryError } from "@sentry/remix";',
153
157
  "export const ErrorBoundary = () => {\n const error = useRouteError();\n captureRemixErrorBoundaryError(error);\n return <div>Something went wrong</div>;\n};",
154
158
  ]);
@@ -156,7 +160,7 @@ describe('Remix', function () {
156
160
  test('builds correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
157
161
  return __generator(this, function (_a) {
158
162
  switch (_a.label) {
159
- case 0: return [4 /*yield*/, (0, utils_3.checkIfBuilds)(projectDir, 'built')];
163
+ case 0: return [4 /*yield*/, (0, utils_1.checkIfBuilds)(projectDir, 'built')];
160
164
  case 1:
161
165
  _a.sent();
162
166
  return [2 /*return*/];
@@ -166,7 +170,7 @@ describe('Remix', function () {
166
170
  test('runs on dev mode correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
167
171
  return __generator(this, function (_a) {
168
172
  switch (_a.label) {
169
- case 0: return [4 /*yield*/, (0, utils_3.checkIfRunsOnDevMode)(projectDir, 'to expose')];
173
+ case 0: return [4 /*yield*/, (0, utils_1.checkIfRunsOnDevMode)(projectDir, 'to expose')];
170
174
  case 1:
171
175
  _a.sent();
172
176
  return [2 /*return*/];
@@ -176,7 +180,7 @@ describe('Remix', function () {
176
180
  test('runs on prod mode correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
177
181
  return __generator(this, function (_a) {
178
182
  switch (_a.label) {
179
- case 0: return [4 /*yield*/, (0, utils_3.checkIfRunsOnProdMode)(projectDir, '[remix-serve]')];
183
+ case 0: return [4 /*yield*/, (0, utils_1.checkIfRunsOnProdMode)(projectDir, '[remix-serve]')];
180
184
  case 1:
181
185
  _a.sent();
182
186
  return [2 /*return*/];
@@ -1 +1 @@
1
- {"version":3,"file":"remix.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/remix.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,iDAAkD;AAClD,kCAKkB;AAClB,kCAA+C;AAC/C,kCAQkB;AAClB,yCAA6B;AAE7B,QAAQ,CAAC,OAAO,EAAE;IAChB,IAAM,WAAW,GAAG,uBAAW,CAAC,KAAK,CAAC;IACtC,IAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAC7B,SAAS,EACT,qCAAqC,CACtC,CAAC;IAEF,SAAS,CAAC;;;;;oBACF,cAAc,GAAG,IAAA,2BAAmB,EAAC,WAAW,EAAE,UAAU,CAAC,CAAC;oBACrC,qBAAM,cAAc,CAAC,aAAa,CAC/D,qCAAqC,CACtC,EAAA;;oBAFK,sBAAsB,GAAG,SAE9B;oBAED,IAAI,sBAAsB,EAAE;wBAC1B,0CAA0C;wBAC1C,cAAc,CAAC,SAAS,CAAC,YAAI,CAAC,IAAI,CAAC,CAAC;wBACpC,cAAc,CAAC,SAAS,CAAC,YAAI,CAAC,KAAK,CAAC,CAAC;qBACtC;oBAE6B,qBAAM,cAAc,CAAC,aAAa,CAC9D,+BAA+B,EAC/B;4BACE,OAAO,EAAE,MAAO;yBACjB,CACF,EAAA;;oBALK,qBAAqB,GAAG,SAK7B;oBAED,IAAI,qBAAqB,EAAE;wBACzB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AC,CAAC,CAAC;IAEH,IAAI,CAAC,kDAAkD,EAAE;QACvD,IAAA,yBAAiB,EAAC,UAAG,UAAU,0BAAuB,EAAE;YACtD,0CAA0C;YAC1C,oCACM,iBAAS,CAAC,WAAW,qUAc9B;SACE,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,wCAAwC,EAAE;QAC7C,IAAA,yBAAiB,EAAC,UAAG,UAAU,0BAAuB,EAAE;YACtD,0CAA0C;YAC1C,oIAEF;SACC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,4DAA4D,EAAE;QACjE,IAAA,yBAAiB,EAAC,UAAG,UAAU,gCAA6B,EAAE;YAC5D,0CAA0C;YAC1C,oCACM,iBAAS,CAAC,WAAW,qEAG9B;SACE,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,yCAAyC,EAAE;QAC9C,IAAA,yBAAiB,EAAC,UAAG,UAAU,kBAAe,EAAE;YAC9C,iEAAiE;YACjE,iKAIH;SACE,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,kBAAkB,EAAE;;;wBACvB,qBAAM,IAAA,qBAAa,EAAC,UAAU,EAAE,OAAO,CAAC,EAAA;;oBAAxC,SAAwC,CAAC;;;;SAC1C,CAAC,CAAC;IAEH,IAAI,CAAC,4BAA4B,EAAE;;;wBACjC,qBAAM,IAAA,4BAAoB,EAAC,UAAU,EAAE,WAAW,CAAC,EAAA;;oBAAnD,SAAmD,CAAC;;;;SACrD,CAAC,CAAC;IAEH,IAAI,CAAC,6BAA6B,EAAE;;;wBAClC,qBAAM,IAAA,6BAAqB,EAAC,UAAU,EAAE,eAAe,CAAC,EAAA;;oBAAxD,SAAwD,CAAC;;;;SAC1D,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable jest/expect-expect */\nimport { Integration } from '../../lib/Constants';\nimport {\n checkEnvBuildPlugin,\n cleanupGit,\n KEYS,\n revertLocalChanges,\n} from '../utils';\nimport { startWizardInstance } from '../utils';\nimport {\n checkFileContents,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnDevMode,\n checkIfRunsOnProdMode,\n checkPackageJson,\n TEST_ARGS,\n} from '../utils';\nimport * as path from 'path';\n\ndescribe('Remix', () => {\n const integration = Integration.remix;\n const projectDir = path.resolve(\n __dirname,\n '../test-applications/remix-test-app',\n );\n\n beforeAll(async () => {\n const wizardInstance = startWizardInstance(integration, projectDir);\n const packageManagerPrompted = await wizardInstance.waitForOutput(\n 'Please select your package manager.',\n );\n\n if (packageManagerPrompted) {\n // Selecting `yarn` as the package manager\n wizardInstance.sendStdin(KEYS.DOWN);\n wizardInstance.sendStdin(KEYS.ENTER);\n }\n\n const tracingOptionPrompted = await wizardInstance.waitForOutput(\n 'Do you want to enable Tracing',\n {\n timeout: 240_000,\n },\n );\n\n if (tracingOptionPrompted) {\n wizardInstance.sendStdin(KEYS.ENTER);\n }\n\n const replayOptionPrompted = await wizardInstance.waitForOutput(\n 'Do you want to enable Sentry Session Replay',\n );\n\n if (replayOptionPrompted) {\n wizardInstance.sendStdin(KEYS.ENTER);\n }\n\n const examplePagePrompted = await wizardInstance.waitForOutput(\n 'Do you want to create an example page',\n {\n optional: true,\n },\n );\n\n if (examplePagePrompted) {\n wizardInstance.sendStdin(KEYS.ENTER);\n wizardInstance.sendStdin(KEYS.ENTER);\n }\n\n await wizardInstance.waitForOutput(\n 'Sentry has been successfully configured for your Remix project',\n );\n\n wizardInstance.kill();\n });\n\n afterAll(() => {\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n });\n\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, integration);\n });\n\n test('.env-sentry-build-plugin is created and contains the auth token', () => {\n checkEnvBuildPlugin(projectDir);\n });\n\n test('example page exists', () => {\n checkFileExists(`${projectDir}/app/routes/sentry-example-page.tsx`);\n });\n\n test('instrumentation.server file exists', () => {\n checkFileExists(`${projectDir}/instrumentation.server.mjs`);\n });\n\n test('entry.client file contains Sentry initialization', () => {\n checkFileContents(`${projectDir}/app/entry.client.tsx`, [\n 'import * as Sentry from \"@sentry/remix\";',\n `Sentry.init({\n dsn: \"${TEST_ARGS.PROJECT_DSN}\",\n tracesSampleRate: 1,\n\n integrations: [Sentry.browserTracingIntegration({\n useEffect,\n useLocation,\n useMatches\n }), Sentry.replayIntegration({\n maskAllText: true,\n blockAllMedia: true\n })],\n\n replaysSessionSampleRate: 0.1,\n replaysOnErrorSampleRate: 1\n})`,\n ]);\n });\n\n test('entry.server file contains Sentry code', () => {\n checkFileContents(`${projectDir}/app/entry.server.tsx`, [\n 'import * as Sentry from \"@sentry/remix\";',\n `export const handleError = Sentry.wrapHandleErrorWithSentry((error, { request }) => {\n // Custom handleError implementation\n});`,\n ]);\n });\n\n test('instrumentation.server file contains Sentry initialization', () => {\n checkFileContents(`${projectDir}/instrumentation.server.mjs`, [\n 'import * as Sentry from \"@sentry/remix\";',\n `Sentry.init({\n dsn: \"${TEST_ARGS.PROJECT_DSN}\",\n tracesSampleRate: 1,\n autoInstrumentRemix: true\n})`,\n ]);\n });\n\n test('root file contains Sentry ErrorBoundary', () => {\n checkFileContents(`${projectDir}/app/root.tsx`, [\n 'import { captureRemixErrorBoundaryError } from \"@sentry/remix\";',\n `export const ErrorBoundary = () => {\n const error = useRouteError();\n captureRemixErrorBoundaryError(error);\n return <div>Something went wrong</div>;\n};`,\n ]);\n });\n\n test('builds correctly', async () => {\n await checkIfBuilds(projectDir, 'built');\n });\n\n test('runs on dev mode correctly', async () => {\n await checkIfRunsOnDevMode(projectDir, 'to expose');\n });\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(projectDir, '[remix-serve]');\n });\n});\n"]}
1
+ {"version":3,"file":"remix.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/remix.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C;IAEH,IAAI,CAAC,yCAAyC,EAAE;QAC9C,IAAA,yBAAiB,EAAC,UAAG,UAAU,kBAAe,EAAE;YAC9C,iEAAiE;YACjE,iKAIH;SACE,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,kBAAkB,EAAE;;;wBACvB,qBAAM,IAAA,qBAAa,EAAC,UAAU,EAAE,OAAO,CAAC,EAAA;;oBAAxC,SAAwC,CAAC;;;;SAC1C,CAAC,CAAC;IAEH,IAAI,CAAC,4BAA4B,EAAE;;;wBACjC,qBAAM,IAAA,4BAAoB,EAAC,UAAU,EAAE,WAAW,CAAC,EAAA;;oBAAnD,SAAmD,CAAC;;;;SACrD,CAAC,CAAC;IAEH,IAAI,CAAC,6BAA6B,EAAE;;;wBAClC,qBAAM,IAAA,6BAAqB,EAAC,UAAU,EAAE,eAAe,CAAC,EAAA;;oBAAxD,SAAwD,CAAC;;;;SAC1D,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable jest/expect-expect */\nimport { Integration } from '../../lib/Constants';\nimport {\n checkEnvBuildPlugin,\n checkFileContents,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnDevMode,\n checkIfRunsOnProdMode,\n checkPackageJson,\n cleanupGit,\n KEYS,\n revertLocalChanges,\n startWizardInstance,\n TEST_ARGS,\n} from '../utils';\nimport * as path from 'path';\n\ndescribe('Remix', () => {\n const integration = Integration.remix;\n const projectDir = path.resolve(\n __dirname,\n '../test-applications/remix-test-app',\n );\n\n beforeAll(async () => {\n const wizardInstance = startWizardInstance(integration, projectDir);\n const packageManagerPrompted = await wizardInstance.waitForOutput(\n 'Please select your package manager.',\n );\n\n const tracingOptionPrompted =\n packageManagerPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Selecting `yarn` as the package manager\n [KEYS.DOWN, KEYS.ENTER],\n // \"Do you want to enable Tracing\", sometimes doesn't work as `Tracing` can be printed in bold.\n 'to track the performance of your application?',\n {\n timeout: 240_000,\n },\n ));\n\n const replayOptionPrompted =\n tracingOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n // \"Do you want to enable Sentry Session Replay\", sometimes doesn't work as `Sentry Session Replay` can be printed in bold.\n 'to get a video-like reproduction of errors during a user session?',\n ));\n\n replayOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Do you want to create an example page',\n {\n optional: true,\n },\n ));\n\n await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER, KEYS.ENTER],\n 'Sentry has been successfully configured for your Remix project',\n );\n\n wizardInstance.kill();\n });\n\n afterAll(() => {\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n });\n\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, integration);\n });\n\n test('.env-sentry-build-plugin is created and contains the auth token', () => {\n checkEnvBuildPlugin(projectDir);\n });\n\n test('example page exists', () => {\n checkFileExists(`${projectDir}/app/routes/sentry-example-page.tsx`);\n });\n\n test('instrumentation.server file exists', () => {\n checkFileExists(`${projectDir}/instrumentation.server.mjs`);\n });\n\n test('entry.client file contains Sentry initialization', () => {\n checkFileContents(`${projectDir}/app/entry.client.tsx`, [\n 'import * as Sentry from \"@sentry/remix\";',\n `Sentry.init({\n dsn: \"${TEST_ARGS.PROJECT_DSN}\",\n tracesSampleRate: 1,\n\n integrations: [Sentry.browserTracingIntegration({\n useEffect,\n useLocation,\n useMatches\n }), Sentry.replayIntegration({\n maskAllText: true,\n blockAllMedia: true\n })],\n\n replaysSessionSampleRate: 0.1,\n replaysOnErrorSampleRate: 1\n})`,\n ]);\n });\n\n test('entry.server file contains Sentry code', () => {\n checkFileContents(`${projectDir}/app/entry.server.tsx`, [\n 'import * as Sentry from \"@sentry/remix\";',\n `export const handleError = Sentry.wrapHandleErrorWithSentry((error, { request }) => {\n // Custom handleError implementation\n});`,\n ]);\n });\n\n test('instrumentation.server file contains Sentry initialization', () => {\n checkFileContents(`${projectDir}/instrumentation.server.mjs`, [\n 'import * as Sentry from \"@sentry/remix\";',\n `Sentry.init({\n dsn: \"${TEST_ARGS.PROJECT_DSN}\",\n tracesSampleRate: 1,\n autoInstrumentRemix: true\n})`,\n ]);\n });\n\n test('root file contains Sentry ErrorBoundary', () => {\n checkFileContents(`${projectDir}/app/root.tsx`, [\n 'import { captureRemixErrorBoundaryError } from \"@sentry/remix\";',\n `export const ErrorBoundary = () => {\n const error = useRouteError();\n captureRemixErrorBoundaryError(error);\n return <div>Something went wrong</div>;\n};`,\n ]);\n });\n\n test('builds correctly', async () => {\n await checkIfBuilds(projectDir, 'built');\n });\n\n test('runs on dev mode correctly', async () => {\n await checkIfRunsOnDevMode(projectDir, 'to expose');\n });\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(projectDir, '[remix-serve]');\n });\n});\n"]}
@@ -0,0 +1 @@
1
+ export {};