@@ -14,7 +14,7 @@ describe('remove-devtools', () => {
1414 ` ,
1515 'test.jsx' ,
1616 3000 ,
17- ) . code ,
17+ ) ! . code ,
1818 )
1919 expect (
2020 output . includes (
@@ -26,96 +26,62 @@ describe('remove-devtools', () => {
2626 } )
2727
2828 test ( 'it does not add enhanced console.logs to console.log that is not called' , ( ) => {
29- const output = removeEmptySpace (
30- enhanceConsoleLog (
31- `
29+ const output = enhanceConsoleLog (
30+ `
3231 console.log
3332 ` ,
34- 'test.jsx' ,
35- 3000 ,
36- ) . code ,
37- )
38- expect ( output ) . toBe (
39- removeEmptySpace ( `
40- console.log
41- ` ) ,
33+ 'test.jsx' ,
34+ 3000 ,
4235 )
36+ expect ( output ) . toBe ( undefined )
4337 } )
4438
4539 test ( 'it does not add enhanced console.logs to console.log that is inside a comment' , ( ) => {
46- const output = removeEmptySpace (
47- enhanceConsoleLog (
48- `
40+ const output = enhanceConsoleLog (
41+ `
4942 // console.log('This is a log')
5043 ` ,
51- 'test.jsx' ,
52- 3000 ,
53- ) . code ,
54- )
55- expect ( output ) . toBe (
56- removeEmptySpace ( `
57- // console.log('This is a log')
58- ` ) ,
44+ 'test.jsx' ,
45+ 3000 ,
5946 )
47+ expect ( output ) . toBe ( undefined )
6048 } )
6149
6250 test ( 'it does not add enhanced console.logs to console.log that is inside a multiline comment' , ( ) => {
63- const output = removeEmptySpace (
64- enhanceConsoleLog (
65- `
51+ const output = enhanceConsoleLog (
52+ `
6653 /*
6754 console.log('This is a log')
6855 */
6956 ` ,
70- 'test.jsx' ,
71- 3000 ,
72- ) . code ,
73- )
74- expect ( output ) . toBe (
75- removeEmptySpace ( `
76- /*
77- console.log('This is a log')
78- */
79- ` ) ,
57+ 'test.jsx' ,
58+ 3000 ,
8059 )
60+ expect ( output ) . toBe ( undefined )
8161 } )
8262
8363 test ( 'it does not add enhanced console.error to console.error that is inside a comment' , ( ) => {
84- const output = removeEmptySpace (
85- enhanceConsoleLog (
86- `
64+ const output = enhanceConsoleLog (
65+ `
8766 // console.error('This is a log')
8867 ` ,
89- 'test.jsx' ,
90- 3000 ,
91- ) . code ,
92- )
93- expect ( output ) . toBe (
94- removeEmptySpace ( `
95- // console.error('This is a log')
96- ` ) ,
68+ 'test.jsx' ,
69+ 3000 ,
9770 )
71+ expect ( output ) . toBe ( undefined )
9872 } )
9973
10074 test ( 'it does not add enhanced console.error to console.error that is inside a multiline comment' , ( ) => {
101- const output = removeEmptySpace (
102- enhanceConsoleLog (
103- `
75+ const output = enhanceConsoleLog (
76+ `
10477 /*
10578 console.error('This is a log')
10679 */
10780 ` ,
108- 'test.jsx' ,
109- 3000 ,
110- ) . code ,
111- )
112- expect ( output ) . toBe (
113- removeEmptySpace ( `
114- /*
115- console.error('This is a log')
116- */
117- ` ) ,
81+ 'test.jsx' ,
82+ 3000 ,
11883 )
84+ expect ( output ) . toBe ( undefined )
11985 } )
12086
12187 test ( 'it adds enhanced console.error to console.error()' , ( ) => {
@@ -126,7 +92,7 @@ describe('remove-devtools', () => {
12692 ` ,
12793 'test.jsx' ,
12894 3000 ,
129- ) . code ,
95+ ) ! . code ,
13096 )
13197 console . log ( 'output' , output )
13298 expect (
@@ -139,19 +105,13 @@ describe('remove-devtools', () => {
139105 } )
140106
141107 test ( 'it does not add enhanced console.error to console.error that is not called' , ( ) => {
142- const output = removeEmptySpace (
143- enhanceConsoleLog (
144- `
108+ const output = enhanceConsoleLog (
109+ `
145110 console.log
146111 ` ,
147- 'test.jsx' ,
148- 3000 ,
149- ) . code ,
150- )
151- expect ( output ) . toBe (
152- removeEmptySpace ( `
153- console.log
154- ` ) ,
112+ 'test.jsx' ,
113+ 3000 ,
155114 )
115+ expect ( output ) . toBe ( undefined )
156116 } )
157117} )
0 commit comments