@@ -1542,7 +1542,7 @@ describe('test/OSSObject.test.ts', () => {
15421542 } ) ;
15431543
15441544 it ( 'should store object to local file' , async ( ) => {
1545- const savePath = path . join ( tmpdir , name . replaceAll ( String . raw `\/` , '-' ) ) ;
1545+ const savePath = path . join ( tmpdir , name . replaceAll ( '/' , '-' ) ) ;
15461546 const result = await ossObject . get ( name , savePath ) ;
15471547 assert . equal ( result . res . status , 200 ) ;
15481548 assert . ok (
@@ -1556,10 +1556,7 @@ describe('test/OSSObject.test.ts', () => {
15561556 } ) ;
15571557
15581558 it ( 'should escape uri path ok' , async ( ) => {
1559- const savePath = path . join (
1560- tmpdir ,
1561- needEscapeName . replaceAll ( String . raw `\/` , '-' )
1562- ) ;
1559+ const savePath = path . join ( tmpdir , needEscapeName . replaceAll ( '/' , '-' ) ) ;
15631560 const result = await ossObject . get ( needEscapeName , savePath ) ;
15641561 assert . equal ( result . res . status , 200 ) ;
15651562 const { size : saveSize } = await stat ( savePath ) ;
@@ -1571,7 +1568,7 @@ describe('test/OSSObject.test.ts', () => {
15711568 const savePath = path . join (
15721569 tmpdir ,
15731570 'not-exists' ,
1574- name . replaceAll ( String . raw `\/` , '-' )
1571+ name . replaceAll ( '/' , '-' )
15751572 ) ;
15761573 await assert . rejects (
15771574 async ( ) => {
@@ -1585,7 +1582,7 @@ describe('test/OSSObject.test.ts', () => {
15851582 } ) ;
15861583
15871584 it ( 'should store object to writeStream' , async ( ) => {
1588- const savePath = path . join ( tmpdir , name . replaceAll ( String . raw `\/` , '-' ) ) ;
1585+ const savePath = path . join ( tmpdir , name . replaceAll ( '/' , '-' ) ) ;
15891586 const result = await ossObject . get ( name , createWriteStream ( savePath ) ) ;
15901587 assert . equal ( result . res . status , 200 ) ;
15911588 const { size } = await stat ( __filename ) ;
@@ -1594,7 +1591,7 @@ describe('test/OSSObject.test.ts', () => {
15941591 } ) ;
15951592
15961593 it ( 'should store not exists object to file' , async ( ) => {
1597- const savePath = path . join ( tmpdir , name . replaceAll ( String . raw `\/` , '-' ) ) ;
1594+ const savePath = path . join ( tmpdir , name . replaceAll ( '/' , '-' ) ) ;
15981595 await assert . rejects (
15991596 async ( ) => {
16001597 await ossObject . get ( `${ name } not-exists` , savePath ) ;
@@ -1612,7 +1609,7 @@ describe('test/OSSObject.test.ts', () => {
16121609 const savePath = path . join (
16131610 tmpdir ,
16141611 'not-exists-dir' ,
1615- name . replaceAll ( String . raw `\/` , '-' )
1612+ name . replaceAll ( '/' , '-' )
16161613 ) ;
16171614 await assert . rejects (
16181615 async ( ) => {
0 commit comments