SEARCH-538

- Review comments
This commit is contained in:
Keerthi Niranjan
2018-01-08 16:57:18 +05:30
parent 4322615e6b
commit 252047891e
2 changed files with 12 additions and 9 deletions

View File

@@ -92,7 +92,7 @@ class Search {
return new Promise((resolve, reject) => {
if (!messages) {
log.send(logLevels.ERROR, 'Batch Indexing: Messages not provided');
reject(new Error('Batch Indexing: Messages is required'));
reject(new Error('Batch Indexing: Messages are required'));
return;
}

View File

@@ -16,14 +16,14 @@ jest.mock('electron', function() {
});
function mockedGetPath(type) {
if (type === 'exe') {
return executionPath;
switch (type) {
case 'exe':
return executionPath;
case 'userData':
return userConfigDir;
default:
return ''
}
if (type === 'userData') {
return userConfigDir
}
return '';
}
describe('Tests for Search Utils', function() {
@@ -37,6 +37,9 @@ describe('Tests for Search Utils', function() {
const { SearchUtils } = require('../js/search/searchUtils.js');
SearchUtilsAPI = new SearchUtils();
SearchUtilsAPI.path = userConfigDir;
if (fs.existsSync(searchConfig.FOLDERS_CONSTANTS.USER_CONFIG_FILE)) {
fs.unlinkSync(searchConfig.FOLDERS_CONSTANTS.USER_CONFIG_FILE);
}
done();
});
@@ -47,7 +50,7 @@ describe('Tests for Search Utils', function() {
describe('Tests for checking disk space', function () {
it('should return free sapce', function (done) {
it('should return free space', function (done) {
const checkFreeSpace = jest.spyOn(SearchUtilsAPI, 'checkFreeSpace');
SearchUtilsAPI.checkFreeSpace().then(function () {
expect(checkFreeSpace).toHaveBeenCalled();