@@ -121,6 +121,37 @@ describe('validateOptions', () => {
121121 ` ) ;
122122 } ) ;
123123
124+ it ( 'should accept "runtimeEntry" when it is an absolute path string' , ( ) => {
125+ expect ( ( ) => {
126+ new ReactRefreshPlugin ( { runtimeEntry : '/test' } ) ;
127+ } ) . not . toThrow ( ) ;
128+ } ) ;
129+
130+ it ( 'should accept "runtimeEntry" when it is a string' , ( ) => {
131+ expect ( ( ) => {
132+ new ReactRefreshPlugin ( { runtimeEntry : 'test' } ) ;
133+ } ) . not . toThrow ( ) ;
134+ } ) ;
135+
136+ it ( 'should accept "runtimeEntry" when it is false' , ( ) => {
137+ expect ( ( ) => {
138+ new ReactRefreshPlugin ( { runtimeEntry : false } ) ;
139+ } ) . not . toThrow ( ) ;
140+ } ) ;
141+
142+ it ( 'should reject "runtimeEntry" when it is not a string nor false' , ( ) => {
143+ expect ( ( ) => {
144+ new ReactRefreshPlugin ( { runtimeEntry : true } ) ;
145+ } ) . toThrowErrorMatchingInlineSnapshot ( `
146+ "Invalid options object. React Refresh Plugin has been initialized using an options object that does not match the API schema.
147+ - options.runtimeEntry should be one of these:
148+ false | string
149+ Details:
150+ * options.runtimeEntry should be equal to constant false.
151+ * options.runtimeEntry should be a string."
152+ ` ) ;
153+ } ) ;
154+
124155 it ( 'should accept "overlay" when it is true' , ( ) => {
125156 expect ( ( ) => {
126157 new ReactRefreshPlugin ( { overlay : true } ) ;
@@ -311,7 +342,7 @@ describe('validateOptions', () => {
311342 } ) . toThrowErrorMatchingInlineSnapshot ( `
312343 "Invalid options object. React Refresh Plugin has been initialized using an options object that does not match the API schema.
313344 - options has an unknown property 'unknown'. These properties are valid:
314- object { esModule?, exclude?, forceEnable?, include?, library?, overlay? }"
345+ object { esModule?, exclude?, forceEnable?, include?, library?, runtimeEntry?, overlay? }"
315346 ` ) ;
316347 } ) ;
317348} ) ;
0 commit comments