@sentry/wizard
Version:
Sentry wizard helping you to configure your project
31 lines (28 loc) • 1.08 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
// @ts-expect-error - magicast is ESM and TS complains about that. It works though
const magicast_1 = require("magicast");
const vitest_1 = require("vitest");
const root_1 = require("../../src/remix/codemods/root");
(0, vitest_1.describe)('wrapAppWithSentry', () => {
(0, vitest_1.it)('should wrap the app with Sentry', () => {
// Empty root.tsx file for testing
const originalRootAst = (0, magicast_1.parseModule)(`
import { Outlet } from '@remix-run/react';
export default function App() {
return <Outlet />;
}
`);
(0, root_1.wrapAppWithSentry)(originalRootAst, 'root.tsx');
const result = originalRootAst.generate().code;
(0, vitest_1.expect)(result).toMatchInlineSnapshot(`
"import {withSentry} from '@sentry/remix';
import { Outlet } from '@remix-run/react';
function App() {
return <Outlet />;
}
export default withSentry(App);"
`);
});
});
//# sourceMappingURL=root.test.js.map