@@ -13,27 +13,27 @@ test('--string', async t => {
1313
1414test ( '--regex' , async t => {
1515 const filePath = await tempWrite ( 'foo bar foo' ) ;
16- await execa ( './cli.js' , [ ' --regex=\\ bb.*?\\b' , '--replacement=foo' , filePath ] ) ;
16+ await execa ( './cli.js' , [ String . raw ` --regex=\bb.*?\b` , '--replacement=foo' , filePath ] ) ;
1717 t . is ( fs . readFileSync ( filePath , 'utf8' ) , 'foo foo foo' ) ;
1818} ) ;
1919
2020test ( 'newlines and tabs' , async t => {
2121 const filePath = await tempWrite ( 'a,b,c' ) ;
22- await execa ( './cli.js' , [ '--string=,' , ' --replacement=\\n' , filePath ] ) ;
22+ await execa ( './cli.js' , [ '--string=,' , String . raw ` --replacement=\n` , filePath ] ) ;
2323 t . is ( fs . readFileSync ( filePath , 'utf8' ) , 'a\nb\nc' ) ;
2424
2525 const filePath2 = await tempWrite ( 'a,b,c' ) ;
26- await execa ( './cli.js' , [ '--string=,' , ' --replacement=\\t' , filePath2 ] ) ;
26+ await execa ( './cli.js' , [ '--string=,' , String . raw ` --replacement=\t` , filePath2 ] ) ;
2727 t . is ( fs . readFileSync ( filePath2 , 'utf8' ) , 'a\tb\tc' ) ;
2828
2929 const filePath3 = await tempWrite ( 'a,b,c' ) ;
30- await execa ( './cli.js' , [ '--string=,' , ' --replacement=\\r' , filePath3 ] ) ;
30+ await execa ( './cli.js' , [ '--string=,' , String . raw ` --replacement=\r` , filePath3 ] ) ;
3131 t . is ( fs . readFileSync ( filePath3 , 'utf8' ) , 'a\rb\rc' ) ;
3232} ) ;
3333
3434test ( 'multiple newlines and tabs' , async t => {
3535 const filePath = await tempWrite ( 'a,b,c' ) ;
36- await execa ( './cli.js' , [ '--string=,' , ' --replacement=\\n\\n\\t\\r' , filePath ] ) ;
36+ await execa ( './cli.js' , [ '--string=,' , String . raw ` --replacement=\n\n\t\r` , filePath ] ) ;
3737 t . is ( fs . readFileSync ( filePath , 'utf8' ) , 'a\n\n\t\rb\n\n\t\rc' ) ;
3838} ) ;
3939
@@ -84,7 +84,7 @@ test('--dry-run with no matches', async t => {
8484
8585test ( '--dry-run with regex' , async t => {
8686 const filePath = await tempWrite ( 'version 1.2.3 here' ) ;
87- const { stdout} = await execa ( './cli.js' , [ '--dry-run' , ' --regex=\\ d+\\.\\ d+\\.\\d+' , '--replacement=2.0.0' , filePath ] ) ;
87+ const { stdout} = await execa ( './cli.js' , [ '--dry-run' , String . raw ` --regex=\d+\.\ d+\.\d+` , '--replacement=2.0.0' , filePath ] ) ;
8888
8989 t . is ( fs . readFileSync ( filePath , 'utf8' ) , 'version 1.2.3 here' ) ;
9090 t . true ( stdout . includes ( 'version 1.2.3 here' ) ) ;
0 commit comments