Skip to content

Commit

Permalink
expose plugins module
Browse files Browse the repository at this point in the history
  • Loading branch information
vutran committed Oct 8, 2016
1 parent dc0d5d0 commit 17948b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 2 additions & 2 deletions __tests__/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('plugins', () => {
// eslint-disable-next-line global-require, no-underscore-dangle
require('child_process').__setCode(null);
await api.install('SHOULD_EXIST', '/jest/test');
expect(await api.getPlugins()).toEqual(['SHOULD_EXIST']);
expect(await api.plugins.getAll()).toEqual(['SHOULD_EXIST']);
});

it('should install a plugin that is already installed', async () => {
Expand Down Expand Up @@ -105,7 +105,7 @@ describe('plugins', () => {
// eslint-disable-next-line global-require, no-underscore-dangle
require('rimraf').__setError(false);
await api.uninstall('SHOULD_EXIST', '/jest/test');
expect(await api.getPlugins()).toEqual([]);
expect(await api.plugins.getAll()).toEqual([]);
});

it('should uninstall a plugin that doesn\'t exist', async () => {
Expand Down
9 changes: 1 addition & 8 deletions src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,6 @@ const getConfig = () => new Promise((resolve) => {
resolve(config.store);
});

/**
* Get all plugins
*
* @return {String[]} - An array of plugin names
*/
const getPlugins = () => plugins.getAll();

module.exports = {
checkOnNpm,
install,
Expand All @@ -183,5 +176,5 @@ module.exports = {
setTheme,
getTheme,
getConfig,
getPlugins,
plugins,
};

0 comments on commit 17948b9

Please sign in to comment.