Skip to content

Commit

Permalink
unneeded tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bwp91 committed Oct 1, 2023
1 parent 64af30a commit ebe8f46
Showing 1 changed file with 0 additions and 64 deletions.
64 changes: 0 additions & 64 deletions test/e2e/plugins.gateway.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,70 +353,6 @@ describe('PluginsGateway (e2e)', () => {
expect(client.emit).toHaveBeenCalledWith('stdout', expect.stringContaining('Operation succeeded!'));
});

it('ON /plugins/homebridge-update (1.2.x -> 1.3.x)', async () => {
// mock get homebridge package
pluginsService.getHomebridgePackage = async () => {
return {
name: 'homebridge',
private: false,
publicPackage: true,
installPath: pluginsPath,
latestVersion: '1.3.0',
installedVersion: '1.2.5'
};
};

jest.spyOn(nodePtyService, 'spawn')
.mockImplementation(() => {
const term = new EventEmitter();
setTimeout(() => {
term.emit('exit', 0);
}, 10);
return term;
});

const writeJsonMock = jest.spyOn(fs, 'writeJsonSync');

try {
await pluginsGateway.homebridgeUpdate(client, { version: 'latest' });
} catch (e) { }

// the save config method should have been called
expect(writeJsonMock).toHaveBeenCalled();
});

it('ON /plugins/homebridge-update (1.1.x -> 1.3.x)', async () => {
// mock get homebridge package
pluginsService.getHomebridgePackage = async () => {
return {
name: 'homebridge',
private: false,
publicPackage: true,
installPath: pluginsPath,
latestVersion: '1.3.0',
installedVersion: '1.1.7'
};
};

jest.spyOn(nodePtyService, 'spawn')
.mockImplementation(() => {
const term = new EventEmitter();
setTimeout(() => {
term.emit('exit', 0);
}, 10);
return term;
});

const writeJsonMock = jest.spyOn(fs, 'writeJsonSync');

try {
await pluginsGateway.homebridgeUpdate(client, { version: 'latest' });
} catch (e) { }

// the save config method should not have been called
expect(writeJsonMock).not.toHaveBeenCalled();
});

afterAll(async () => {
await app.close();
});
Expand Down

0 comments on commit ebe8f46

Please sign in to comment.