Skip to content
Permalink
Browse files
Don't fake return values for functions that return undefined
  • Loading branch information
raphinesse committed Sep 6, 2018
1 parent 6b680e1 commit 81bfa94b080b04abeb00051651ffb8c077cf5459
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
@@ -83,8 +83,8 @@ describe('plugman/uninstall', () => {
uninstall.__set__('npmUninstall', jasmine.createSpy());

emit = spyOn(events, 'emit');
spyOn(fs, 'writeFileSync').and.returnValue(true);
spyOn(fs, 'removeSync').and.returnValue(true);
spyOn(fs, 'writeFileSync');
spyOn(fs, 'removeSync');
});

afterEach(() => {
@@ -103,7 +103,7 @@ describe('plugman/uninstall', () => {
setupProject('uninstall.test');

spyOn(ActionStack.prototype, 'process').and.returnValue(Q());
spyOn(fs, 'copySync').and.returnValue(true);
spyOn(fs, 'copySync');
});

describe('success', function () {
@@ -55,7 +55,7 @@ describe('cordova/plugin/add', function () {
};
plugin_info_provider_revert_mock = add.__set__('PluginInfoProvider', plugin_info_provider_mock);
spyOn(fs, 'existsSync').and.returnValue(false);
spyOn(fs, 'writeFileSync').and.returnValue(false);
spyOn(fs, 'writeFileSync');
package_json_mock = jasmine.createSpyObj('package json mock', ['cordova', 'dependencies', 'devDependencies']);
package_json_mock.cordova = {};
package_json_mock.dependencies = {};
@@ -23,7 +23,7 @@ describe('plugman/create', () => {

it('Test 002 : should be successful', function () {
spyOn(fs, 'existsSync').and.returnValue(false);
spyOn(fs, 'ensureDirSync').and.returnValue(true);
spyOn(fs, 'ensureDirSync');
spyOn(fs, 'writeFileSync');

return create('name', 'org.plugin.id', '0.0.0', '.', [])
@@ -116,13 +116,13 @@ describe('plugman/install', () => {
cb(null, '', '');
});
spyOn(superspawn, 'spawn').and.returnValue(Q('3.1.0'));
spyOn(fs, 'ensureDirSync').and.returnValue(true);
spyOn(fs, 'ensureDirSync');
spyOn(platforms, 'copyFile').and.returnValue(true);

fetchSpy = spyOn(plugman, 'fetch').and.returnValue(Q(pluginDir('com.cordova.engine')));
spyOn(fs, 'writeFileSync').and.returnValue(true);
spyOn(fs, 'copySync').and.returnValue(true);
spyOn(fs, 'removeSync').and.returnValue(true);
spyOn(fs, 'writeFileSync');
spyOn(fs, 'copySync');
spyOn(fs, 'removeSync');
spyOn(PlatformJson.prototype, 'addInstalledPluginToPrepareQueue');
});

0 comments on commit 81bfa94

Please sign in to comment.