spec/helpers.js
function createWithMockFetch (dir, id, name, cfg, events) {
    const mockFetchDest = path.join(tmpDir, 'mockFetchDest');
    const templateDir = path.dirname(require.resolve('cordova-app-hello-world'));
    const fetchSpy = jasmine.createSpy('fetchSpy')
        .and.callFake(() => Promise.resolve(mockFetchDest));

    fs.copySync(templateDir, mockFetchDest);
    return createWith({fetch: fetchSpy})(dir, id, name, cfg, events)
        .then(() => fetchSpy);
}
function createWithMockFetch (dir, id, name, cfg, events) {
    const mockFetchDest = path.join(tmpDir, 'mockFetchDest');
    const templateDir = path.dirname(require.resolve('cordova-app-hello-world'));
    const fetchSpy = jasmine.createSpy('fetchSpy')
        .and.callFake(() => Promise.resolve(mockFetchDest));

    fs.copySync(templateDir, mockFetchDest);
    return createWith({fetch: fetchSpy})(dir, id, name, cfg, events)
        .then(() => fetchSpy);
}
function createWithMockFetch ( dir , id , name , cfg , events ) { const mockFetchDest = path . join ( tmpDir , 'mockFetchDest' ) ; const templateDir = path . dirname ( require . resolve ( 'cordova-app-hello-world' ) ) ; const fetchSpy = jasmine . createSpy ( 'fetchSpy' ) . and . callFake ( ( ) => Promise . resolve ( mockFetchDest ) ) ; fs . copySync ( templateDir , mockFetchDest ) ; return createWith ( { fetch : fetchSpy } ) ( dir , id , name , cfg , events ) . then ( ( ) => fetchSpy ) ; }
Calls create with mocked fetch to not depend on the outside world
Calls create with mocked fetch to not depend on the outside world