mirror of
https://github.com/azure/login.git
synced 2026-03-15 09:20:56 -04:00
Added Unit tests (#15)
* Added unit tests for Azure PowerShell * Added unit tests * changes in utils * removed babel * changed variable name of enable-PSSession * refactor * added ci.yml * changes in utils test
This commit is contained in:
@@ -13,9 +13,4 @@ export default class PowerShellToolRunner {
|
||||
static async executePowerShellScriptBlock(scriptBlock: string, options: any = {}) {
|
||||
await exec.exec(`${PowerShellToolRunner.psPath} -Command`, [scriptBlock], options)
|
||||
}
|
||||
|
||||
static async executePowerShellCommand(command: string, options: any = {}) {
|
||||
await exec.exec(`"${PowerShellToolRunner.psPath}" -Command "${command}"`, [], options);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,12 +7,9 @@ import PowerShellToolRunner from './PowerShellToolRunner';
|
||||
export default class Utils {
|
||||
/**
|
||||
* Add the folder path where Az modules are present to PSModulePath based on runner
|
||||
*
|
||||
* @param azPSVersion
|
||||
*
|
||||
* @param azPSVersion
|
||||
* If azPSVersion is empty, folder path in which all Az modules are present are set
|
||||
* If azPSVersion is not empty, folder path of exact Az module version is set
|
||||
*
|
||||
*/
|
||||
static setPSModulePath(azPSVersion: string = "") {
|
||||
let modulePath: string = "";
|
||||
@@ -34,7 +31,7 @@ export default class Utils {
|
||||
process.env.PSModulePath = `${modulePath}${process.env.PSModulePath}`;
|
||||
}
|
||||
|
||||
static async getLatestModule(moduleName: string): Promise<any> {
|
||||
static async getLatestModule(moduleName: string): Promise<string> {
|
||||
let output: string = "";
|
||||
const options: any = {
|
||||
listeners: {
|
||||
|
||||
Reference in New Issue
Block a user