@@ -101,7 +101,7 @@ describe("react-declassify", () => {
101101 class C extends React.Component {}
102102 ` ;
103103 const output = dedent `\
104- /* react-declassify:disabled Cannot perform transformation: Missing render method */
104+ /* react-declassify-disable Cannot perform transformation: Missing render method */
105105 class C extends React.Component {}
106106 ` ;
107107 expect ( transform ( input ) ) . toBe ( output ) ;
@@ -114,7 +114,7 @@ describe("react-declassify", () => {
114114 }
115115 ` ;
116116 const output = dedent `\
117- /* react-declassify:disabled Cannot perform transformation: Missing render method */
117+ /* react-declassify-disable Cannot perform transformation: Missing render method */
118118 class C extends React.Component {
119119 rende() {}
120120 }
@@ -295,6 +295,37 @@ describe("react-declassify", () => {
295295 ` ;
296296 expect ( transform ( input ) ) . toBe ( input ) ;
297297 } ) ;
298+
299+ describe ( "opt-out" , ( ) => {
300+ it ( "ignores if marked as react-declassify-disable" , ( ) => {
301+ const input = dedent `\
302+ /* react-declassify-disable */
303+ class C extends React.Component {
304+ render() {}
305+ }
306+ ` ;
307+ expect ( transform ( input ) ) . toBe ( input ) ;
308+ } ) ;
309+
310+ it ( "ignores if marked as abstract" , ( ) => {
311+ const input = dedent `\
312+ abstract class C extends React.Component {
313+ render() {}
314+ }
315+ ` ;
316+ expect ( transform ( input , { ts : true } ) ) . toBe ( input ) ;
317+ } ) ;
318+
319+ it ( "ignores if marked as @abstract" , ( ) => {
320+ const input = dedent `\
321+ /** @abstract */
322+ class C extends React.Component {
323+ render() {}
324+ }
325+ ` ;
326+ expect ( transform ( input ) ) . toBe ( input ) ;
327+ } ) ;
328+ } ) ;
298329 } ) ;
299330
300331 describe ( "Class forms" , ( ) => {
0 commit comments