mirror of
https://github.com/status-im/react-native.git
synced 2025-01-17 21:11:45 +00:00
32 lines
887 B
JavaScript
32 lines
887 B
JavaScript
|
jest.autoMockOff();
|
||
|
|
||
|
const findManifest = require('../../src/config/android/findManifest');
|
||
|
const readManifest = require('../../src/config/android/readManifest');
|
||
|
const mockFs = require('mock-fs');
|
||
|
const mocks = require('../fixtures/android');
|
||
|
|
||
|
describe('android::readManifest', () => {
|
||
|
|
||
|
beforeAll(() => mockFs({
|
||
|
empty: {},
|
||
|
nested: {
|
||
|
android: {
|
||
|
app: mocks.valid,
|
||
|
},
|
||
|
},
|
||
|
}));
|
||
|
|
||
|
it('should return manifest content if file exists in the folder', () => {
|
||
|
const manifestPath = findManifest('nested');
|
||
|
expect(readManifest(manifestPath)).not.toBe(null);
|
||
|
expect(typeof readManifest(manifestPath)).toBe('object');
|
||
|
});
|
||
|
|
||
|
it('should throw an error if there is no manifest in the folder', () => {
|
||
|
const fakeManifestPath = findManifest('empty');
|
||
|
expect(() => readManifest(fakeManifestPath)).toThrow();
|
||
|
});
|
||
|
|
||
|
afterAll(mockFs.restore);
|
||
|
});
|