mirror of
https://github.com/status-im/react-native.git
synced 2025-01-09 09:12:02 +00:00
29 lines
758 B
JavaScript
29 lines
758 B
JavaScript
|
const chai = require('chai');
|
||
|
const expect = chai.expect;
|
||
|
const mock = require('mock-fs');
|
||
|
const fs = require('fs');
|
||
|
const path = require('path');
|
||
|
const isInstalled = require('../../src/android/isInstalled');
|
||
|
|
||
|
const projectConfig = {
|
||
|
buildGradlePath: 'build.gradle',
|
||
|
};
|
||
|
|
||
|
describe('android::isInstalled', () => {
|
||
|
before(() => mock({
|
||
|
'build.gradle': fs.readFileSync(
|
||
|
path.join(__dirname, '../fixtures/android/patchedBuild.gradle')
|
||
|
),
|
||
|
}));
|
||
|
|
||
|
it('should return true when project is already in build.gradle', () =>
|
||
|
expect(isInstalled(projectConfig, 'test')).to.be.true
|
||
|
);
|
||
|
|
||
|
it('should return false when project is not in build.gradle', () =>
|
||
|
expect(isInstalled(projectConfig, 'test2')).to.be.false
|
||
|
);
|
||
|
|
||
|
after(mock.restore);
|
||
|
});
|