breautek commented on pull request #1173:
URL: https://github.com/apache/cordova-android/pull/1173#issuecomment-806865851


   > Well, adding spyOn(create, 'writeNameForAndroidStudio'); started to pass 
the tests. But it's showing some red mark in the last result. Not sure if those 
are okay-
   
   In jasmine, by default when you spy on a function, it will not call on the 
original implementation which is why it seemed to fix everything. I think this 
is okay since we don't need to test `writeNameForAndroidStudio` in every single 
test case.
   
   But we should have something like the following somewhere:
   
   ```javascript
   describe('writeNameForAndroidStudio', () => {
      it('should call ensureDirSync with path', () => {
       spyOn(fs, 'ensureDirSync');
       blah.writeNameForAndroidStudio(path); // Whatever what the interface 
is... 
       expect(fs.ensureDirSync).toHaveBeenCalledWith("thePathValue that is 
expected to have been passed into ensureDirSync");
     });
   
     it('should call wrilteFileSync', () => {
       // basically the same for above but with writeFileSync instead.
     });
   });
   ```
   That way the `writeNameForAndriodStudio` is also tested.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to