@@ -29,9 +29,7 @@ describe('testing locking', () => {
2929
3030 test ( 'file should fail to be found to be locked' , done => {
3131 lockFile ( getFilePath ( 'package.fail.json' ) , ( error : Error ) => {
32- expect ( error . message ) . toMatch (
33- / E N O E N T : n o s u c h f i l e o r d i r e c t o r y , s t a t ' ( .* ) p a c k a g e .f a i l .j s o n ' /
34- ) ;
32+ expect ( error . message ) . toMatch ( / E N O E N T : n o s u c h f i l e o r d i r e c t o r y , s t a t ' ( .* ) p a c k a g e .f a i l .j s o n ' / ) ;
3533 done ( ) ;
3634 } ) ;
3735 } ) ;
@@ -53,34 +51,28 @@ describe('testing locking', () => {
5351
5452 test ( 'read file with no options should to be found to be read it as object' , done => {
5553 const options = {
56- parse : true
54+ parse : true ,
5755 } ;
58- readFile (
59- getFilePath ( 'package.json' ) ,
60- options ,
61- ( error : Error , data : any ) => {
62- expect ( error ) . toBeNull ( ) ;
63- expect ( data ) . toMatchSnapshot ( ) ;
64- done ( ) ;
65- }
66- ) ;
56+ readFile ( getFilePath ( 'package.json' ) , options , ( error : Error , data : any ) => {
57+ expect ( error ) . toBeNull ( ) ;
58+ expect ( data ) . toMatchSnapshot ( ) ;
59+ done ( ) ;
60+ } ) ;
6761 } ) ;
6862
6963 test ( 'read file with options (parse) should to be not found to be read it' , done => {
7064 const options = {
71- parse : true
65+ parse : true ,
7266 } ;
7367 readFile ( getFilePath ( 'package.fail.json' ) , options , ( error : Error ) => {
74- expect ( error . message ) . toMatch (
75- / E N O E N T : n o s u c h f i l e o r d i r e c t o r y , o p e n ' ( .* ) p a c k a g e .f a i l .j s o n ' /
76- ) ;
68+ expect ( error . message ) . toMatch ( / E N O E N T : n o s u c h f i l e o r d i r e c t o r y , o p e n ' ( .* ) p a c k a g e .f a i l .j s o n ' / ) ;
7769 done ( ) ;
7870 } ) ;
7971 } ) ;
8072
8173 test ( 'read file with options should to be found to be read it and fails to be parsed' , done => {
8274 const options = {
83- parse : true
75+ parse : true ,
8476 } ;
8577 const errorMessage =
8678 process . platform === 'win32'
@@ -95,24 +87,20 @@ describe('testing locking', () => {
9587 test ( 'read file with options (parse, lock) should to be found to be read it as object' , done => {
9688 const options = {
9789 parse : true ,
98- lock : true
90+ lock : true ,
9991 } ;
100- readFile (
101- getFilePath ( 'package2.json' ) ,
102- options ,
103- ( error : Error , data : any ) => {
104- expect ( error ) . toBeNull ( ) ;
105- expect ( data ) . toMatchSnapshot ( ) ;
106- removeTempFile ( 'package2.json.lock' ) ;
107- done ( ) ;
108- }
109- ) ;
92+ readFile ( getFilePath ( 'package2.json' ) , options , ( error : Error , data : any ) => {
93+ expect ( error ) . toBeNull ( ) ;
94+ expect ( data ) . toMatchSnapshot ( ) ;
95+ removeTempFile ( 'package2.json.lock' ) ;
96+ done ( ) ;
97+ } ) ;
11098 } ) ;
11199
112100 test ( 'read file with options (parse, lock) should to be found to be read it and fails to be parsed' , done => {
113101 const options = {
114102 parse : true ,
115- lock : true
103+ lock : true ,
116104 } ;
117105 const errorMessage =
118106 process . platform === 'win32'
0 commit comments