Open brucebrit opened 5 years ago
Hi,
I am writing a unit testing using jasmine on an application (an electron + angular). Below shows partial code in the unit test
const service: FileIntegrityService = TestBed.get(FileIntegrityService); mockFs({ 'G:/':{} }) service.saveContentToFileSync("Hello World", "G:/me.txt") console.log(fs.readFileSync("G:/me.txt","utf-8")) //The console log empty string, instead of "Hello World"
Inside the FileIntegrityService
saveContentToFileSync(content: string, savePath: string): void { fs.writeFileSync(savePath,content) }
My query is why console.log show empty string?
hi, anyone?
Maybe try to remove the G:.
G:
Hi,
I am writing a unit testing using jasmine on an application (an electron + angular). Below shows partial code in the unit test
Inside the FileIntegrityService
My query is why console.log show empty string?