@@ -3,6 +3,7 @@ import * as os from 'os';
33import * as path from 'path' ;
44import type { Plugin , ResolvedConfig } from 'vite' ;
55import { afterEach , beforeEach , describe , expect , it , vi } from 'vitest' ;
6+ import Sentry from '../../src' ;
67import { sentryRemixVitePlugin } from '../../src/config/vite' ;
78
89describe ( 'sentryRemixVitePlugin' , ( ) => {
@@ -35,21 +36,21 @@ describe('sentryRemixVitePlugin', () => {
3536
3637 describe ( 'plugin configuration' , ( ) => {
3738 it ( 'should return a valid Vite plugin with correct name' , ( ) => {
38- const plugin = sentryRemixVitePlugin ( ) ;
39+ const plugin = Sentry . sentryRemixVitePlugin ( ) ;
3940
4041 expect ( plugin ) . toBeDefined ( ) ;
4142 expect ( plugin . name ) . toBe ( 'sentry-remix-route-manifest' ) ;
4243 expect ( plugin . enforce ) . toBe ( 'post' ) ;
4344 } ) ;
4445
4546 it ( 'should accept custom appDirPath option' , ( ) => {
46- const plugin = sentryRemixVitePlugin ( { appDirPath : '/custom/path' } ) ;
47+ const plugin = Sentry . sentryRemixVitePlugin ( { appDirPath : '/custom/path' } ) ;
4748
4849 expect ( plugin ) . toBeDefined ( ) ;
4950 } ) ;
5051
5152 it ( 'should work with no options' , ( ) => {
52- const plugin = sentryRemixVitePlugin ( ) ;
53+ const plugin = Sentry . sentryRemixVitePlugin ( ) ;
5354
5455 expect ( plugin ) . toBeDefined ( ) ;
5556 } ) ;
@@ -62,9 +63,7 @@ describe('sentryRemixVitePlugin', () => {
6263 fs . writeFileSync ( path . join ( routesDir , 'about.tsx' ) , '// about' ) ;
6364 fs . writeFileSync ( path . join ( routesDir , 'users.$id.tsx' ) , '// users' ) ;
6465
65- const plugin = sentryRemixVitePlugin ( ) as Plugin & {
66- configResolved : ( config : ResolvedConfig ) => void ;
67- } ;
66+ const plugin = Sentry . sentryRemixVitePlugin ( ) ;
6867
6968 const mockConfig : Partial < ResolvedConfig > = {
7069 root : tempDir ,
@@ -83,9 +82,7 @@ describe('sentryRemixVitePlugin', () => {
8382 fs . writeFileSync ( path . join ( routesDir , 'index.tsx' ) , '// index' ) ;
8483 fs . writeFileSync ( path . join ( routesDir , 'users.$id.tsx' ) , '// users' ) ;
8584
86- const plugin = sentryRemixVitePlugin ( ) as Plugin & {
87- configResolved : ( config : ResolvedConfig ) => void ;
88- } ;
85+ const plugin = Sentry . sentryRemixVitePlugin ( ) ;
8986
9087 const mockConfig : Partial < ResolvedConfig > = {
9188 root : tempDir ,
@@ -101,9 +98,7 @@ describe('sentryRemixVitePlugin', () => {
10198 } ) ;
10299
103100 it ( 'should handle errors gracefully and set empty manifest' , ( ) => {
104- const plugin = sentryRemixVitePlugin ( { appDirPath : '/nonexistent/path' } ) as Plugin & {
105- configResolved : ( config : ResolvedConfig ) => void ;
106- } ;
101+ const plugin = Sentry . sentryRemixVitePlugin ( { appDirPath : '/nonexistent/path' } ) ;
107102
108103 const mockConfig : Partial < ResolvedConfig > = {
109104 root : tempDir ,
@@ -124,9 +119,7 @@ describe('sentryRemixVitePlugin', () => {
124119 fs . mkdirSync ( customRoutesDir , { recursive : true } ) ;
125120 fs . writeFileSync ( path . join ( customRoutesDir , 'index.tsx' ) , '// index' ) ;
126121
127- const plugin = sentryRemixVitePlugin ( { appDirPath : customAppDir } ) as Plugin & {
128- configResolved : ( config : ResolvedConfig ) => void ;
129- } ;
122+ const plugin = Sentry . sentryRemixVitePlugin ( { appDirPath : customAppDir } ) ;
130123
131124 const mockConfig : Partial < ResolvedConfig > = {
132125 root : tempDir ,
@@ -144,13 +137,7 @@ describe('sentryRemixVitePlugin', () => {
144137 it ( 'should inject manifest into HTML with <head> tag' , ( ) => {
145138 fs . writeFileSync ( path . join ( routesDir , 'index.tsx' ) , '// index' ) ;
146139
147- const plugin = sentryRemixVitePlugin ( ) as Plugin & {
148- configResolved : ( config : ResolvedConfig ) => void ;
149- transformIndexHtml : {
150- order : string ;
151- handler : ( html : string ) => string ;
152- } ;
153- } ;
140+ const plugin = Sentry . sentryRemixVitePlugin ( ) ;
154141
155142 const mockConfig : Partial < ResolvedConfig > = {
156143 root : tempDir ,
0 commit comments