-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.js
35 lines (28 loc) · 978 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const assert = require( 'assert' );
const fs = require( 'fs' );
const plistFixture = fs.readFileSync( './fixtures/fixture.plist', {
encoding: 'UTF-8',
} );
const proxyquire = require( 'proxyquire' );
const CertDownloaderStub = ( ( options ) => {
function CertDownloader( options ) {};
CertDownloader.prototype.verify = ( file, callback ) => {
callback( null, plistFixture );
};
return CertDownloader;
} )();
const provisioning = proxyquire( './', {
'@stendahls/cert-downloader': CertDownloaderStub,
} );
describe( 'should call exec correctly and parse plist data', () => {
it( 'return parsed data as object', (done) => {
provisioning( 'embedded.mobileprovision', ( error, data ) => {
assert.equal( error, null );
assert.deepEqual( data, {
"AppIDName": "com-facebook-facebook",
"TeamName": "Facebook Inc.",
} );
done();
} );
} );
} );