Skip to content

Commit

Permalink
fix: remove test functions out of the class
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurkale22 committed Aug 1, 2019
1 parent 7394545 commit 37b6575
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ export class PluginLoader {
}
return this;
}
}

/**
* Adds a search path for plugin modules. Intended for testing purposes only.
* @param searchPath The path to add.
*/
static set searchPathForTest(searchPath: string) {
module.paths.push(searchPath);
}
/**
* Adds a search path for plugin modules. Intended for testing purposes only.
* @param searchPath The path to add.
*/
export function searchPathForTest(searchPath: string) {
module.paths.push(searchPath);
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import * as path from 'path';
import {
HookState,
PluginLoader,
searchPathForTest,
} from '../../src/instrumentation/PluginLoader';

const INSTALLED_PLUGINS_PATH = path.join(__dirname, 'node_modules');
Expand All @@ -31,7 +32,7 @@ describe('PluginLoader', () => {

before(() => {
module.paths.push(INSTALLED_PLUGINS_PATH);
PluginLoader.searchPathForTest = INSTALLED_PLUGINS_PATH;
searchPathForTest(INSTALLED_PLUGINS_PATH);
});

afterEach(() => {
Expand Down

0 comments on commit 37b6575

Please sign in to comment.