mirror of
https://github.com/status-im/react-native.git
synced 2025-01-16 20:44:10 +00:00
45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
|
'use strict';
|
||
|
|
||
|
jest.dontMock('../install');
|
||
|
jest.dontMock('fs');
|
||
|
jest.dontMock('path');
|
||
|
|
||
|
var install = require('../install.js');
|
||
|
|
||
|
var openingReactTag = '#<React-Native>';
|
||
|
var closingReactTag = '#</React-Native>';
|
||
|
|
||
|
var fs = require.requireActual('fs');
|
||
|
var path = require.requireActual('path');
|
||
|
|
||
|
process.chdir(__dirname);
|
||
|
|
||
|
describe('setup Podfile', function() {
|
||
|
|
||
|
it('creates a Podfile if none exists', function() {
|
||
|
try {
|
||
|
fs.unlinkSync(path.resolve(__dirname, 'Podfile'));
|
||
|
} catch(e) {}
|
||
|
|
||
|
var setupPodfile = install.setupPodfile();
|
||
|
|
||
|
expect(setupPodfile.created).toBe(true);
|
||
|
});
|
||
|
|
||
|
it('does not create Podfile if one exists', function() {
|
||
|
var setupPodfile = install.setupPodfile();
|
||
|
expect(setupPodfile.created).toBe(false);
|
||
|
});
|
||
|
|
||
|
it('includes React Native Tags', function() {
|
||
|
var setupPodfile = install.setupPodfile();
|
||
|
|
||
|
expect(setupPodfile.podfileText).toContain(openingReactTag);
|
||
|
expect(setupPodfile.podfileText).toContain(closingReactTag);
|
||
|
|
||
|
try {
|
||
|
fs.unlinkSync(path.resolve(__dirname, 'Podfile'));
|
||
|
} catch(e) {}
|
||
|
});
|
||
|
});
|