import createTestHelpers from '../createTestHelpers';
const {expectTransform, expectNoChange} = createTestHelpers(['no-strict']);

describe('Removal of "use strict"', () => {
  it('should remove statement with "use strict" string', () => {
    expectTransform('"use strict";').toReturn('');
    expectTransform('\'use strict\';').toReturn('');
  });

  it('should remove the whole line where "use strict" used to be', () => {
    expectTransform('"use strict";\nfoo();').toReturn('foo();');
    expectTransform('foo();\n"use strict";\nbar();').toReturn('foo();\nbar();');
  });

  it('should not remove comments before "use strict"', () => {
    expectTransform('// foo();\n"use strict";\nbar();').toReturn('// foo();\nbar();');
  });

  it('should keep "use strict" used inside other code', () => {
    expectNoChange('x = "use strict";');
    expectNoChange('foo("use strict");');
  });
});

@@ -431,32 +431,39 @@
 expectTransform(
+%0A      
 '%22use strict%22;%5Cn
@@ -462,23 +462,39 @@
 rict%22;%5Cn
+' +%0A      '
 foo();'
+%0A    
 ).toRetu
@@ -496,24 +496,31 @@
 oReturn(
+%0A      
 'foo();'
 );%0A    e
@@ -511,19 +511,25 @@
 'foo();'
+%0A    
 );%0A
+%0A
     expe
@@ -540,16 +540,23 @@
 ansform(
+%0A      
 'foo();%5C
@@ -548,32 +548,43 @@
 %0A      'foo();%5Cn
+' +%0A      '
 %22use strict%22;%5Cnb
@@ -574,39 +574,55 @@
 '%22use strict%22;%5Cn
+' +%0A      '
 bar();'
+%0A    
 ).toReturn('foo(
@@ -616,16 +616,23 @@
 oReturn(
+%0A      
 'foo();%5C
@@ -624,39 +624,55 @@
 %0A      'foo();%5Cn
+' +%0A      '
 bar();'
+%0A    
 );%0A  %7D);%0A%0A  it('
@@ -748,28 +748,47 @@
 ansform(
-'// foo();%5Cn
+%0A      '// comment%5Cn' +%0A      '
 %22use str
@@ -794,23 +794,39 @@
 rict%22;%5Cn
+' +%0A      '
 bar();'
+%0A    
 ).toRetu
@@ -832,27 +832,51 @@
 urn(
-'// foo();%5Cn
+%0A      '// comment%5Cn' +%0A      '
 bar();'
+%0A    
 );%0A 

Split multiline tests to actual multiple lines