@@ -32,13 +32,36 @@ describe('Browser main tests', function () {
3232 expect ( fs . name ) . to . equal ( 'phoenixFS' ) ;
3333 } ) ;
3434
35- it ( 'Should phoenix native read write in browser' , async function ( ) {
35+ it ( 'Should phoenix native write in browser' , async function ( ) {
3636 let writeSuccess = false ;
3737 fs . writeFile ( `${ window . mountTestPath } /browserWrite.txt` , 'hello World' , 'utf8' , ( err ) => {
3838 if ( ! err ) {
3939 writeSuccess = true ;
4040 }
4141 } ) ;
42- await waitForTrue ( ( ) => { return writeSuccess ; } , 1 ) ;
42+ await waitForTrue ( ( ) => { return writeSuccess ; } , 1000 ) ;
43+ expect ( writeSuccess ) . to . be . true ;
44+ } ) ;
45+
46+ it ( 'Should phoenix native read in browser' , async function ( ) {
47+ let readSuccess = false ;
48+ fs . readFile ( `${ window . mountTestPath } /browserWrite.txt` , 'utf8' , ( err ) => {
49+ if ( ! err ) {
50+ readSuccess = true ;
51+ }
52+ } ) ;
53+ await waitForTrue ( ( ) => { return readSuccess ; } , 1000 ) ;
54+ expect ( readSuccess ) . to . be . true ;
55+ } ) ;
56+
57+ it ( 'Should phoenix native delete in browser' , async function ( ) {
58+ let delSuccess = false ;
59+ fs . unlink ( `${ window . mountTestPath } /browserWrite.txt` , ( err ) => {
60+ if ( ! err ) {
61+ delSuccess = true ;
62+ }
63+ } ) ;
64+ await waitForTrue ( ( ) => { return delSuccess ; } , 1000 ) ;
65+ expect ( delSuccess ) . to . be . true ;
4366 } ) ;
4467} ) ;
0 commit comments