Skip to content

Commit 3a48e1b

Browse files
committed
desloüg
1 parent d6e225d commit 3a48e1b

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

packages/tanstackstart-react/src/vite/copyInstrumentationFile.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ export function makeCopyInstrumentationFilePlugin(): Plugin {
4444
consoleSandbox(() => {
4545
// eslint-disable-next-line no-console
4646
console.warn(
47-
'[Sentry TanStack Start] Could not determine server output directory. ' +
48-
'Could not detect nitro, cloudflare, or netlify vite plugin. ' +
47+
'[Sentry TanStack Start] Could not detect nitro, cloudflare, or netlify vite plugin. ' +
4948
'The instrument.server.mjs file will not be copied to the build output automatically.',
5049
);
5150
});

packages/tanstackstart-react/test/vite/copyInstrumentationFile.test.ts

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ describe('makeCopyInstrumentationFilePlugin()', () => {
119119
expect(fs.promises.access).toHaveBeenCalled();
120120
});
121121

122-
it('does not set output dir when neither Nitro nor Cloudflare/Netlify is detected', () => {
122+
it('logs a warning and does not set output dir when no recognized plugin is detected', () => {
123123
const resolvedConfig = {
124124
root: '/project',
125125
plugins: [{ name: 'some-other-plugin' }],
@@ -131,26 +131,11 @@ describe('makeCopyInstrumentationFilePlugin()', () => {
131131

132132
(plugin.closeBundle as AnyFunction)();
133133

134-
expect(fs.promises.access).not.toHaveBeenCalled();
135-
136-
warnSpy.mockRestore();
137-
});
138-
139-
it('logs a warning when no recognized deployment plugin is detected', () => {
140-
const resolvedConfig = {
141-
root: '/project',
142-
plugins: [{ name: 'some-other-plugin' }],
143-
} as unknown as ResolvedConfig;
144-
145-
const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {});
146-
147-
(plugin.configResolved as AnyFunction)(resolvedConfig);
148-
149134
expect(warnSpy).toHaveBeenCalledWith(
150-
'[Sentry TanStack Start] Could not determine server output directory. ' +
151-
'Could not detect nitro, cloudflare, or netlify vite plugin. ' +
135+
'[Sentry TanStack Start] Could not detect nitro, cloudflare, or netlify vite plugin. ' +
152136
'The instrument.server.mjs file will not be copied to the build output automatically.',
153137
);
138+
expect(fs.promises.access).not.toHaveBeenCalled();
154139

155140
warnSpy.mockRestore();
156141
});

0 commit comments

Comments
 (0)