raphinesse commented on a change in pull request #763: refactor: replace 
superspawn & child_process with execa
URL: https://github.com/apache/cordova-ios/pull/763#discussion_r364458436
 
 

 ##########
 File path: tests/spec/unit/lib/list-devices.spec.js
 ##########
 @@ -17,30 +17,24 @@
        under the License.
 */
 
+const fs = require('fs-extra');
+const path = require('path');
+const execa = require('execa');
 const list_devices = 
require('../../../../bin/templates/scripts/cordova/lib/list-devices');
-const Q = require('q');
+
+const sampleData = 
fs.readFileSync(path.resolve('tests/spec/unit/fixtures/sample-ioreg-output.txt'),
 'utf-8');
 
 describe('cordova/lib/list-devices', () => {
     describe('run method', () => {
         beforeEach(() => {
-            spyOn(Q, 'all').and.returnValue(Q.resolve([]));
-            spyOn(Q, 'nfcall');
-        });
-        it('should invoke proper system calls to retrieve connected devices', 
() => {
-            return list_devices.run()
-                .then(() => {
-                    
expect(Q.nfcall).toHaveBeenCalledWith(jasmine.any(Function), 
jasmine.stringMatching(/ioreg.*iPad/g));
-                    
expect(Q.nfcall).toHaveBeenCalledWith(jasmine.any(Function), 
jasmine.stringMatching(/ioreg.*iPod/g));
-                    
expect(Q.nfcall).toHaveBeenCalledWith(jasmine.any(Function), 
jasmine.stringMatching(/ioreg.*iPhone/g));
 
 Review comment:
   Maybe keep one of those expectations?

----------------------------------------------------------------
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]


With regards,
Apache Git Services

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

Reply via email to