phonegap-build
Advanced tools
Comparing version 0.10.0 to 1.0.0
{ | ||
"name": "phonegap-build", | ||
"description": "PhoneGap Build node library.", | ||
"version": "0.10.0", | ||
"version": "1.0.0", | ||
"homepage": "http://github.com/phonegap/node-phonegap-build", | ||
@@ -19,35 +19,39 @@ "repository": { | ||
"scripts": { | ||
"test": "jasmine-node --color spec" | ||
"test": "jasmine" | ||
}, | ||
"engines": { | ||
"node": ">=0.8.0" | ||
"node": ">=6.0.0" | ||
}, | ||
"dependencies": { | ||
"colors": "0.6.x", | ||
"jasmine": "^3.2.0", | ||
"optimist": "0.3.x", | ||
"phonegap-build-api": "1.0.0", | ||
"prompt": "0.2.x", | ||
"shelljs": "0.0.x", | ||
"optimist": "0.3.x", | ||
"qrcode-terminal": "0.8.x", | ||
"phonegap-build-api": "0.4.0" | ||
"shelljs": "0.0.x" | ||
}, | ||
"devDependencies": { | ||
"jasmine-node": "1.10.1" | ||
}, | ||
"optionalDependencies": { | ||
}, | ||
"contributors": [{ | ||
"name": "Michael Brooks", | ||
"email": "michael@michaelbrooks.ca", | ||
"url": "http://michaelbrooks.ca" | ||
}, | ||
{ | ||
"name": "Mathijs de Bruin", | ||
"email": "mathijs@mathijsfietst.nl", | ||
"url": "http://djangopeople.net/dokterbob" | ||
}, | ||
{ | ||
"name": "Benn Mapes", | ||
"email": "benn.mapes@gmail.com", | ||
"url": "http://github.com/bennmapes" | ||
}] | ||
"devDependencies": {}, | ||
"optionalDependencies": {}, | ||
"contributors": [ | ||
{ | ||
"name": "Michael Brooks", | ||
"email": "michael@michaelbrooks.ca", | ||
"url": "http://michaelbrooks.ca" | ||
}, | ||
{ | ||
"name": "Mathijs de Bruin", | ||
"email": "mathijs@mathijsfietst.nl", | ||
"url": "http://djangopeople.net/dokterbob" | ||
}, | ||
{ | ||
"name": "Benn Mapes", | ||
"email": "benn.mapes@gmail.com", | ||
"url": "http://github.com/bennmapes" | ||
}, | ||
{ | ||
"name": "Jesse MacFadyen", | ||
"url": "https://github.com/purplecabbage" | ||
} | ||
] | ||
} |
@@ -1,2 +0,2 @@ | ||
# PhoneGap Build Node Module [![Build Status][travis-ci-img]][travis-ci-url] [![bitHound Score][bithound-img]][bithound-url] | ||
# PhoneGap Build Node Module [![Build Status][travis-ci-img]][travis-ci-url] | ||
@@ -195,4 +195,2 @@ > Node module to create and build PhoneGap projects with PhoneGap Build. | ||
[travis-ci-url]: https://travis-ci.org/phonegap/node-phonegap-build | ||
[bithound-img]: https://www.bithound.io/github/phonegap/node-phonegap-build/badges/score.svg | ||
[bithound-url]: https://www.bithound.io/github/phonegap/node-phonegap-build | ||
@@ -32,3 +32,3 @@ /* | ||
expect(fs.exists).toHaveBeenCalled(); | ||
expect(fs.exists.mostRecentCall.args[0]).toEqual( | ||
expect(fs.exists.calls.mostRecent().args[0]).toEqual( | ||
path.join(config.global.path, 'config.json') | ||
@@ -40,3 +40,3 @@ ); | ||
beforeEach(function() { | ||
spyOn(fs, 'exists').andCallFake(function(filepath, callback) { | ||
spyOn(fs, 'exists').and.callFake(function(filepath, callback) { | ||
callback(true); | ||
@@ -50,3 +50,3 @@ }); | ||
expect(fs.readFile).toHaveBeenCalled(); | ||
expect(fs.readFile.mostRecentCall.args[0]).toEqual( | ||
expect(fs.readFile.calls.mostRecent().args[0]).toEqual( | ||
path.join(config.global.path, 'config.json') | ||
@@ -58,3 +58,3 @@ ); | ||
beforeEach(function() { | ||
spyOn(fs, 'readFile').andCallFake(function(filepath, callback) { | ||
spyOn(fs, 'readFile').and.callFake(function(filepath, callback) { | ||
callback(null, '{ "phonegap" : { "token": "abc123" } }'); | ||
@@ -81,3 +81,3 @@ }); | ||
beforeEach(function() { | ||
spyOn(fs, 'readFile').andCallFake(function(filepath, callback) { | ||
spyOn(fs, 'readFile').and.callFake(function(filepath, callback) { | ||
callback(new Error('file does not exist')); | ||
@@ -105,3 +105,3 @@ }); | ||
beforeEach(function() { | ||
spyOn(fs, 'exists').andCallFake(function(filepath, callback) { | ||
spyOn(fs, 'exists').and.callFake(function(filepath, callback) { | ||
callback(false); | ||
@@ -119,3 +119,3 @@ }); | ||
beforeEach(function() { | ||
spyOn(config.global, 'save').andCallFake(function(data, callback) { | ||
spyOn(config.global, 'save').and.callFake(function(data, callback) { | ||
callback(null); | ||
@@ -127,3 +127,3 @@ }); | ||
config.global.load(function(e, data) {}); | ||
expect(config.global.save.mostRecentCall.args[0]).toEqual({ phonegap: {} }); | ||
expect(config.global.save.calls.mostRecent().args[0]).toEqual({ phonegap: {} }); | ||
}); | ||
@@ -148,3 +148,3 @@ | ||
beforeEach(function() { | ||
spyOn(config.global, 'save').andCallFake(function(data, callback) { | ||
spyOn(config.global, 'save').and.callFake(function(data, callback) { | ||
callback(new Error('no write access')); | ||
@@ -189,3 +189,3 @@ }); | ||
expect(shell.mkdir).toHaveBeenCalled(); | ||
expect(shell.mkdir.mostRecentCall.args[0]).toEqual('-p'); | ||
expect(shell.mkdir.calls.mostRecent().args[0]).toEqual('-p'); | ||
}); | ||
@@ -196,3 +196,3 @@ | ||
expect(fs.writeFile).toHaveBeenCalled(); | ||
expect(fs.writeFile.mostRecentCall.args[0]).toEqual( | ||
expect(fs.writeFile.calls.mostRecent().args[0]).toEqual( | ||
path.join(config.global.path, 'config.json') | ||
@@ -204,3 +204,3 @@ ); | ||
beforeEach(function() { | ||
fs.writeFile.andCallFake(function(filepath, data, callback) { | ||
fs.writeFile.and.callFake(function(filepath, data, callback) { | ||
callback(null); | ||
@@ -212,3 +212,3 @@ }); | ||
config.global.save(data, function(e) {}); | ||
expect(fs.writeFile.mostRecentCall.args[0]).toEqual( | ||
expect(fs.writeFile.calls.mostRecent().args[0]).toEqual( | ||
path.join(config.global.path, 'config.json') | ||
@@ -220,3 +220,3 @@ ); | ||
config.global.save({ phonegap: { token: 'def456', username: 'link' } }, function(e) { | ||
var data = JSON.parse(fs.writeFile.mostRecentCall.args[1]); | ||
var data = JSON.parse(fs.writeFile.calls.mostRecent().args[1]); | ||
expect(data).toEqual({ phonegap: { token: 'def456', username: 'link' } }); | ||
@@ -237,3 +237,3 @@ done(); | ||
beforeEach(function() { | ||
fs.writeFile.andCallFake(function(filepath, data, callback) { | ||
fs.writeFile.and.callFake(function(filepath, data, callback) { | ||
callback(new Error('no write access')); | ||
@@ -240,0 +240,0 @@ }); |
@@ -15,4 +15,6 @@ /* | ||
describe('config.local.load(callback)', function() { | ||
let readFileSpy; | ||
beforeEach(function() { | ||
spyOn(fs, 'readFile'); | ||
readFileSpy = spyOn(fs, 'readFile'); | ||
}); | ||
@@ -29,3 +31,3 @@ | ||
expect(fs.readFile).toHaveBeenCalled(); | ||
expect(fs.readFile.mostRecentCall.args[0]).toEqual( | ||
expect(fs.readFile.calls.argsFor(0)[0]).toEqual( | ||
path.join(process.cwd(), '.cordova', 'config.json') | ||
@@ -37,3 +39,3 @@ ); | ||
beforeEach(function() { | ||
fs.readFile.andCallFake(function(path, callback) { | ||
readFileSpy.and.callFake(function(path, callback) { | ||
callback(null, '{}'); | ||
@@ -60,3 +62,3 @@ }); | ||
beforeEach(function() { | ||
fs.readFile.andCallFake(function(path, callback) { | ||
fs.readFile.and.callFake(function(path, callback) { | ||
callback(new Error('file not found')); | ||
@@ -108,3 +110,3 @@ }); | ||
expect(fs.writeFile).toHaveBeenCalled(); | ||
expect(fs.writeFile.mostRecentCall.args[1]).toEqual(JSON.stringify(data)); | ||
expect(fs.writeFile.calls.mostRecent().args[1]).toEqual(JSON.stringify(data)); | ||
}); | ||
@@ -114,3 +116,3 @@ | ||
beforeEach(function() { | ||
fs.writeFile.andCallFake(function(filepath, data, callback) { | ||
fs.writeFile.and.callFake(function(filepath, data, callback) { | ||
callback(null); | ||
@@ -130,3 +132,3 @@ }); | ||
beforeEach(function() { | ||
fs.writeFile.andCallFake(function(filepath, data, callback) { | ||
fs.writeFile.and.callFake(function(filepath, data, callback) { | ||
callback(new Error('permission denied')); | ||
@@ -133,0 +135,0 @@ }); |
@@ -68,3 +68,3 @@ /* | ||
expect( | ||
phonegapbuild.login.mostRecentCall.args[0].protocol | ||
phonegapbuild.login.calls.mostRecent().args[0].protocol | ||
).toEqual('http:'); | ||
@@ -77,3 +77,3 @@ }); | ||
expect( | ||
phonegapbuild.login.mostRecentCall.args[0].host | ||
phonegapbuild.login.calls.mostRecent().args[0].host | ||
).toEqual('stage.build.phonegap.com'); | ||
@@ -86,3 +86,3 @@ }); | ||
expect( | ||
phonegapbuild.login.mostRecentCall.args[0].port | ||
phonegapbuild.login.calls.mostRecent().args[0].port | ||
).toEqual('1337'); | ||
@@ -95,3 +95,3 @@ }); | ||
expect( | ||
phonegapbuild.login.mostRecentCall.args[0].path | ||
phonegapbuild.login.calls.mostRecent().args[0].path | ||
).toEqual('/api/v1'); | ||
@@ -104,3 +104,3 @@ }); | ||
expect( | ||
phonegapbuild.login.mostRecentCall.args[0].proxy | ||
phonegapbuild.login.calls.mostRecent().args[0].proxy | ||
).toEqual('my.proxy.com'); | ||
@@ -112,3 +112,3 @@ }); | ||
beforeEach(function() { | ||
phonegapbuild.login.andCallFake(function(options, callback) { | ||
phonegapbuild.login.and.callFake(function(options, callback) { | ||
callback(null, { /* api */ }); | ||
@@ -120,3 +120,3 @@ }); | ||
beforeEach(function() { | ||
config.local.load.andCallFake(function(callback) { | ||
config.local.load.and.callFake(function(callback) { | ||
callback(null, { 'phonegap': { 'id': 12345 } }); | ||
@@ -143,3 +143,3 @@ }); | ||
beforeEach(function() { | ||
phonegapbuild.build.build.andCallFake(function(options, callback) { | ||
phonegapbuild.build.build.and.callFake(function(options, callback) { | ||
callback(null, appData); | ||
@@ -166,3 +166,3 @@ }); | ||
beforeEach(function() { | ||
phonegapbuild.build.build.andCallFake(function(options, callback) { | ||
phonegapbuild.build.build.and.callFake(function(options, callback) { | ||
callback(new Error('server did not respond')); | ||
@@ -191,3 +191,3 @@ }); | ||
beforeEach(function() { | ||
config.local.load.andCallFake(function(callback) { | ||
config.local.load.and.callFake(function(callback) { | ||
callback(null, {}); | ||
@@ -207,3 +207,3 @@ }); | ||
beforeEach(function() { | ||
phonegapbuild.build.create.andCallFake(function(options, callback) { | ||
phonegapbuild.build.create.and.callFake(function(options, callback) { | ||
callback(null, appData); | ||
@@ -230,3 +230,3 @@ }); | ||
beforeEach(function() { | ||
phonegapbuild.build.create.andCallFake(function(options, callback) { | ||
phonegapbuild.build.create.and.callFake(function(options, callback) { | ||
callback(new Error('server did not respond')); | ||
@@ -256,3 +256,3 @@ }); | ||
beforeEach(function() { | ||
phonegapbuild.login.andCallFake(function(options, callback) { | ||
phonegapbuild.login.and.callFake(function(options, callback) { | ||
var e = new Error('incorrect username or password'); | ||
@@ -259,0 +259,0 @@ phonegapbuild.emit('error', e); |
@@ -90,7 +90,7 @@ /* | ||
beforeEach(function() { | ||
zip.compress.andCallFake(function(wwwPath, buildPath, callback) { | ||
zip.compress.and.callFake(function(wwwPath, buildPath, callback) { | ||
callback(null, '/path/to/build/www.zip'); | ||
}); | ||
config.local.load.andCallFake(function(callback) { | ||
config.local.load.and.callFake(function(callback) { | ||
callback(null, { | ||
@@ -115,3 +115,3 @@ 'phonegap': { | ||
beforeEach(function() { | ||
options.api.put.andCallFake(function(path, headers, callback) { | ||
options.api.put.and.callFake(function(path, headers, callback) { | ||
callback(null, {}); | ||
@@ -133,3 +133,3 @@ }); | ||
beforeEach(function() { | ||
build.waitForComplete.andCallFake(function(options, callback) { | ||
build.waitForComplete.and.callFake(function(options, callback) { | ||
callback(null, appData); | ||
@@ -156,3 +156,3 @@ }); | ||
beforeEach(function() { | ||
build.waitForComplete.andCallFake(function(options, callback) { | ||
build.waitForComplete.and.callFake(function(options, callback) { | ||
callback(new Error('server did not respond')); | ||
@@ -173,3 +173,3 @@ }); | ||
beforeEach(function() { | ||
options.api.put.andCallFake(function(path, headers, callback) { | ||
options.api.put.and.callFake(function(path, headers, callback) { | ||
callback(new Error('Server did not respond')); | ||
@@ -176,0 +176,0 @@ }); |
@@ -65,3 +65,3 @@ /* | ||
beforeEach(function() { | ||
phonegapbuild.create.local.andCallFake(function(options, callback) { | ||
phonegapbuild.create.local.and.callFake(function(options, callback) { | ||
callback(null); | ||
@@ -81,3 +81,3 @@ }); | ||
beforeEach(function() { | ||
phonegapbuild.create.local.andCallFake(function(options, callback) { | ||
phonegapbuild.create.local.and.callFake(function(options, callback) { | ||
callback(new Error('app path already exists')); | ||
@@ -144,3 +144,3 @@ }); | ||
beforeEach(function() { | ||
fs.exists.andCallFake(function(path, callback) { | ||
fs.exists.and.callFake(function(path, callback) { | ||
callback(false); | ||
@@ -153,3 +153,3 @@ }); | ||
expect(shell.cp).toHaveBeenCalled(); | ||
expect(shell.cp.mostRecentCall.args[0]).toEqual('-R'); | ||
expect(shell.cp.calls.mostRecent().args[0]).toEqual('-R'); | ||
}); | ||
@@ -159,3 +159,3 @@ | ||
beforeEach(function() { | ||
spyOn(shell, 'error').andReturn(null); | ||
spyOn(shell, 'error').and.returnValue(null); | ||
}); | ||
@@ -173,8 +173,10 @@ | ||
beforeEach(function() { | ||
spyOn(shell, 'error').andReturn('no write access to path'); | ||
spyOn(shell, 'error').and.returnValue('no write access to path'); | ||
}); | ||
it('should not throw an error', function() { | ||
it('should not throw an error', function(done) { | ||
expect(function() { | ||
phonegapbuild.create.local(options, function(e) {}); | ||
phonegapbuild.create.local(options, function(e) { | ||
done(); | ||
}); | ||
}).not.toThrow(); | ||
@@ -194,3 +196,3 @@ }); | ||
beforeEach(function() { | ||
fs.exists.andCallFake(function(path, callback) { | ||
fs.exists.and.callFake(function(path, callback) { | ||
callback(true); | ||
@@ -197,0 +199,0 @@ }); |
@@ -82,11 +82,11 @@ /* | ||
expect(fs.readFile).toHaveBeenCalled(); | ||
expect(fs.readFile.mostRecentCall.args[0]).toMatch('www/config.xml'); | ||
expect(fs.readFile.calls.mostRecent().args[0]).toMatch('www/config.xml'); | ||
}); | ||
it('should fallback to my-app/config.xml', function() { | ||
spyOn(fs, 'existsSync').andReturn(true); | ||
spyOn(fs, 'existsSync').and.returnValue(true); | ||
create(options, function(e, data) {}); | ||
expect(fs.readFile).toHaveBeenCalled(); | ||
expect(fs.readFile.mostRecentCall.args[0]).not.toMatch('www/config.xml'); | ||
expect(fs.readFile.mostRecentCall.args[0]).toMatch('/config.xml'); | ||
expect(fs.readFile.calls.mostRecent().args[0]).not.toMatch('www/config.xml'); | ||
expect(fs.readFile.calls.mostRecent().args[0]).toMatch('/config.xml'); | ||
}); | ||
@@ -97,3 +97,3 @@ | ||
expect(fs.readFile).toHaveBeenCalled(); | ||
expect(fs.readFile.mostRecentCall.args[0]).toMatch(/config\.xml$/); | ||
expect(fs.readFile.calls.mostRecent().args[0]).toMatch(/config\.xml$/); | ||
}); | ||
@@ -104,3 +104,3 @@ }); | ||
beforeEach(function() { | ||
fs.readFile.andCallFake(function(path, encoding, callback) { | ||
fs.readFile.and.callFake(function(path, encoding, callback) { | ||
callback(null, '<widget><name>My App</name></widget>'); | ||
@@ -121,3 +121,3 @@ }); | ||
beforeEach(function() { | ||
zip.compress.andCallFake(function(wwwPath, buildPath, callback) { | ||
zip.compress.and.callFake(function(wwwPath, buildPath, callback) { | ||
callback(null, '/path/to/build/www.zip'); | ||
@@ -138,3 +138,3 @@ }); | ||
beforeEach(function() { | ||
options.api.post.andCallFake(function(path, headers, callback) { | ||
options.api.post.and.callFake(function(path, headers, callback) { | ||
callback(null, { id: '10' }); | ||
@@ -156,3 +156,3 @@ }); | ||
beforeEach(function() { | ||
config.local.load.andCallFake(function(callback) { | ||
config.local.load.and.callFake(function(callback) { | ||
callback(null, {}); | ||
@@ -169,3 +169,3 @@ }); | ||
beforeEach(function() { | ||
config.local.save.andCallFake(function(data, callback) { | ||
config.local.save.and.callFake(function(data, callback) { | ||
callback(null); | ||
@@ -182,3 +182,3 @@ }); | ||
beforeEach(function() { | ||
create.waitForComplete.andCallFake(function(options, callback) { | ||
create.waitForComplete.and.callFake(function(options, callback) { | ||
callback(null, appData); | ||
@@ -204,3 +204,3 @@ }); | ||
beforeEach(function() { | ||
create.waitForComplete.andCallFake(function(options, callback) { | ||
create.waitForComplete.and.callFake(function(options, callback) { | ||
callback(new Error('server did not respond')); | ||
@@ -221,3 +221,3 @@ }); | ||
beforeEach(function() { | ||
config.local.save.andCallFake(function(data, callback) { | ||
config.local.save.and.callFake(function(data, callback) { | ||
callback(new Error('could not write config.json')); | ||
@@ -238,3 +238,3 @@ }); | ||
beforeEach(function() { | ||
config.local.load.andCallFake(function(callback) { | ||
config.local.load.and.callFake(function(callback) { | ||
callback(new Error('could not read config.json')); | ||
@@ -260,3 +260,3 @@ }); | ||
beforeEach(function() { | ||
options.api.post.andCallFake(function(path, headers, callback) { | ||
options.api.post.and.callFake(function(path, headers, callback) { | ||
callback(new Error('PhoneGap Build did not respond')); | ||
@@ -282,3 +282,3 @@ }); | ||
beforeEach(function() { | ||
zip.compress.andCallFake(function(wwwPath, buildPath, callback) { | ||
zip.compress.and.callFake(function(wwwPath, buildPath, callback) { | ||
callback(new Error('Write access denied')); | ||
@@ -305,3 +305,3 @@ }); | ||
beforeEach(function() { | ||
fs.readFile.andCallFake(function(path, encoding, callback) { | ||
fs.readFile.and.callFake(function(path, encoding, callback) { | ||
callback(new Error('could not open file')); | ||
@@ -321,3 +321,3 @@ }); | ||
beforeEach(function() { | ||
fs.readFile.andCallFake(function(path, encoding, callback) { | ||
fs.readFile.and.callFake(function(path, encoding, callback) { | ||
callback(null, '<widget></widget>'); | ||
@@ -324,0 +324,0 @@ }); |
@@ -41,6 +41,7 @@ /* | ||
it('should try to find auth token', function() { | ||
it('should try to find auth token', function(done) { | ||
phonegapbuild.login(options, function(e, api) {}); | ||
process.nextTick(function() { | ||
expect(config.global.load).toHaveBeenCalled(); | ||
done(); | ||
}); | ||
@@ -51,3 +52,3 @@ }); | ||
beforeEach(function() { | ||
config.global.load.andCallFake(function(callback) { | ||
config.global.load.and.callFake(function(callback) { | ||
callback(null, { | ||
@@ -120,3 +121,3 @@ 'phonegap': { | ||
beforeEach(function() { | ||
config.global.load.andCallFake(function(callback) { | ||
config.global.load.and.callFake(function(callback) { | ||
callback(new Error('config not found at ~/.cordova')); | ||
@@ -144,3 +145,3 @@ }); | ||
beforeEach(function() { | ||
client.auth.andCallFake(function(options, callback) { | ||
client.auth.and.callFake(function(options, callback) { | ||
callback(null, { token: 'abc123' }); | ||
@@ -155,3 +156,3 @@ }); | ||
expect( | ||
config.global.save.mostRecentCall.args[0].phonegap.token | ||
config.global.save.calls.mostRecent().args[0].phonegap.token | ||
).toEqual('abc123'); | ||
@@ -164,3 +165,3 @@ done(); | ||
beforeEach(function() { | ||
config.global.save.andCallFake(function(data, callback) { | ||
config.global.save.and.callFake(function(data, callback) { | ||
callback(null); | ||
@@ -187,3 +188,3 @@ }); | ||
beforeEach(function() { | ||
config.global.save.andCallFake(function(data, callback) { | ||
config.global.save.and.callFake(function(data, callback) { | ||
callback(new Error('No write permission')); | ||
@@ -219,3 +220,3 @@ }); | ||
beforeEach(function() { | ||
client.auth.andCallFake(function(options, callback) { | ||
client.auth.and.callFake(function(options, callback) { | ||
callback(new Error('account does not exist')); | ||
@@ -306,3 +307,3 @@ }); | ||
beforeEach(function() { | ||
config.global.load.andCallFake(function(callback) { | ||
config.global.load.and.callFake(function(callback) { | ||
callback(new Error('cannot read config file')); | ||
@@ -309,0 +310,0 @@ }); |
@@ -46,3 +46,3 @@ /* | ||
beforeEach(function() { | ||
config.global.load.andCallFake(function(callback) { | ||
config.global.load.and.callFake(function(callback) { | ||
callback(null, { | ||
@@ -67,3 +67,3 @@ phonegap: { | ||
beforeEach(function() { | ||
config.global.save.andCallFake(function(data, callback) { | ||
config.global.save.and.callFake(function(data, callback) { | ||
callback(null); | ||
@@ -76,3 +76,3 @@ }); | ||
process.nextTick(function() { | ||
expect(config.global.save.mostRecentCall.args[0].phonegap.token).not.toBeDefined(); | ||
expect(config.global.save.calls.mostRecent().args[0].phonegap.token).not.toBeDefined(); | ||
done(); | ||
@@ -85,3 +85,3 @@ }); | ||
process.nextTick(function() { | ||
expect(config.global.save.mostRecentCall.args[0]).toEqual( | ||
expect(config.global.save.calls.mostRecent().args[0]).toEqual( | ||
{ | ||
@@ -107,3 +107,3 @@ phonegap: { | ||
beforeEach(function() { | ||
config.global.save.andCallFake(function(data, callback) { | ||
config.global.save.and.callFake(function(data, callback) { | ||
callback(new Error('no write access')); | ||
@@ -132,3 +132,3 @@ }); | ||
beforeEach(function() { | ||
config.global.load.andCallFake(function(callback) { | ||
config.global.load.and.callFake(function(callback) { | ||
callback(new Error('no read access')); | ||
@@ -135,0 +135,0 @@ }); |
@@ -28,3 +28,3 @@ /* | ||
spyOn(shell, 'cp'); | ||
spyOn(shell, 'exec').andReturn({ code: 0 }); | ||
spyOn(shell, 'exec').and.returnValue({ code: 0 }); | ||
spyOn(shell, 'rm'); | ||
@@ -59,3 +59,3 @@ spyOn(shell, 'cd'); | ||
beforeEach(function() { | ||
fs.exists.andCallFake(function(path, callback) { | ||
fs.exists.and.callFake(function(path, callback) { | ||
callback(true); | ||
@@ -80,3 +80,3 @@ }); | ||
it('should copy my-app/config.xml when it exists', function() { | ||
fs.existsSync.andReturn(true); | ||
fs.existsSync.and.returnValue(true); | ||
zip.compress('./www', './build', function(e, path) {}); | ||
@@ -90,3 +90,3 @@ expect(shell.cp).toHaveBeenCalledWith( | ||
it('should not copy my-app/config.xml when it does not exist', function() { | ||
fs.existsSync.andReturn(false); | ||
fs.existsSync.and.returnValue(false); | ||
zip.compress('./www', './build', function(e, path) {}); | ||
@@ -106,3 +106,3 @@ expect(shell.cp).not.toHaveBeenCalledWith( | ||
beforeEach(function() { | ||
spyOn(os, 'type').andReturn('Windows_NT'); | ||
spyOn(os, 'type').and.returnValue('Windows_NT'); | ||
}); | ||
@@ -112,3 +112,3 @@ | ||
zip.compress('./www', './build', function(e, path) {}); | ||
expect(shell.exec.mostRecentCall.args[0]).toMatch('wscript'); | ||
expect(shell.exec.calls.mostRecent().args[0]).toMatch('wscript'); | ||
}); | ||
@@ -118,4 +118,4 @@ | ||
zip.compress('./www', './build', function(e, path) {}); | ||
expect(shell.exec.mostRecentCall.args[0]).toMatch(p.resolve('./build/www')); | ||
expect(shell.exec.mostRecentCall.args[0]).toMatch(p.resolve('./build')); | ||
expect(shell.exec.calls.mostRecent().args[0]).toMatch(p.resolve('./build/www')); | ||
expect(shell.exec.calls.mostRecent().args[0]).toMatch(p.resolve('./build')); | ||
}); | ||
@@ -125,3 +125,3 @@ | ||
zip.compress('./path/to the/www', './build', function(e, path) {}); | ||
expect(shell.exec.mostRecentCall.args[0]).toMatch( | ||
expect(shell.exec.calls.mostRecent().args[0]).toMatch( | ||
p.resolve('build/www.zip') | ||
@@ -133,3 +133,3 @@ ); | ||
zip.compress('./www', './path/to the/build', function(e, path) {}); | ||
expect(shell.exec.mostRecentCall.args[0]).toMatch( | ||
expect(shell.exec.calls.mostRecent().args[0]).toMatch( | ||
p.resolve('./path/to the/build') | ||
@@ -142,3 +142,3 @@ ); | ||
beforeEach(function() { | ||
spyOn(os, 'type').andReturn('Darwin'); | ||
spyOn(os, 'type').and.returnValue('Darwin'); | ||
}); | ||
@@ -148,3 +148,3 @@ | ||
zip.compress('./www', './build', function(e, path) {}); | ||
expect(shell.exec.mostRecentCall.args[0]).toMatch(/^zip/); | ||
expect(shell.exec.calls.mostRecent().args[0]).toMatch(/^zip/); | ||
}); | ||
@@ -154,3 +154,3 @@ | ||
zip.compress('./path/to the/www', './build', function(e, path) {}); | ||
expect(shell.exec.mostRecentCall.args[0]).toMatch( | ||
expect(shell.exec.calls.mostRecent().args[0]).toMatch( | ||
p.resolve('build/www.zip') | ||
@@ -162,3 +162,3 @@ ); | ||
zip.compress('./www', './path/to the/build', function(e, path) {}); | ||
expect(shell.exec.mostRecentCall.args[0]).toMatch( | ||
expect(shell.exec.calls.mostRecent().args[0]).toMatch( | ||
p.resolve('./path/to the/build') | ||
@@ -171,3 +171,3 @@ ); | ||
beforeEach(function() { | ||
shell.exec.andReturn({ code: 0 }); | ||
shell.exec.and.returnValue({ code: 0 }); | ||
}); | ||
@@ -192,3 +192,3 @@ | ||
beforeEach(function() { | ||
shell.exec.andReturn({ code: 1 }); | ||
shell.exec.and.returnValue({ code: 1 }); | ||
}); | ||
@@ -212,3 +212,3 @@ | ||
beforeEach(function() { | ||
fs.exists.andCallFake(function(path, callback) { | ||
fs.exists.and.callFake(function(path, callback) { | ||
callback(false); | ||
@@ -240,3 +240,3 @@ }); | ||
beforeEach(function() { | ||
fs.existsSync.andReturn(true); | ||
fs.existsSync.and.returnValue(true); | ||
}); | ||
@@ -252,3 +252,3 @@ | ||
beforeEach(function() { | ||
fs.existsSync.andReturn(false); | ||
fs.existsSync.and.returnValue(false); | ||
}); | ||
@@ -265,3 +265,3 @@ | ||
beforeEach(function() { | ||
fs.existsSync.andReturn(true); | ||
fs.existsSync.and.returnValue(true); | ||
}); | ||
@@ -277,3 +277,3 @@ | ||
beforeEach(function() { | ||
fs.existsSync.andReturn(false); | ||
fs.existsSync.and.returnValue(false); | ||
}); | ||
@@ -280,0 +280,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
6006
0
1509924
7
88
196
1
+ Addedjasmine@^3.2.0
+ Addedajv@6.12.6(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedjasmine@3.99.0(transitive)
+ Addedjasmine-core@3.99.1(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedphonegap-build-api@1.0.0(transitive)
+ Addedpsl@1.15.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)
- Removedphonegap-build-api@0.4.0(transitive)
- Removedrequest@2.11.4(transitive)
Updatedphonegap-build-api@1.0.0