Skip to content

Commit

Permalink
chore: Update deprecated method name (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Dec 1, 2024
1 parent 58510d9 commit 645e9e5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/commands/execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ commands.execute = async function execute (script, args) {
script = script.replace(WINDOWS_EXTENSION_SCRIPT_PATTERN, '').trim();
return await this.executeWindowsCommand(script, _.isArray(args) ? args[0] : args);
} else if (POWER_SHELL_SCRIPT_PATTERN.test(script)) {
this.ensureFeatureEnabled(POWER_SHELL_FEATURE);
this.assertFeatureEnabled(POWER_SHELL_FEATURE);
return await this.execPowerShell(_.isArray(args) ? _.first(args) : args);
}
throw new errors.NotImplementedError();
Expand Down
6 changes: 3 additions & 3 deletions lib/commands/file-movement.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const KNOWN_ENV_VARS = [
const commands = {};

commands.pushFile = async function pushFile (remotePath, base64Data) {
this.ensureFeatureEnabled(MODIFY_FS_FEATURE);
this.assertFeatureEnabled(MODIFY_FS_FEATURE);
if (remotePath.endsWith(path.sep)) {
throw new errors.InvalidArgumentError(
'It is expected that remote path points to a file rather than a folder. ' +
Expand Down Expand Up @@ -65,7 +65,7 @@ commands.pullFolder = async function pullFolder (remotePath) {
* remote path is not an absolute path.
*/
commands.windowsDeleteFile = async function windowsDeleteFile (opts) {
this.ensureFeatureEnabled(MODIFY_FS_FEATURE);
this.assertFeatureEnabled(MODIFY_FS_FEATURE);
const { remotePath } = opts ?? {};
const fullPath = resolveToAbsolutePath(remotePath);
await checkFileExists(fullPath);
Expand All @@ -89,7 +89,7 @@ commands.windowsDeleteFile = async function windowsDeleteFile (opts) {
* remote path is not an absolute path.
*/
commands.windowsDeleteFolder = async function windowsDeleteFolder (opts) {
this.ensureFeatureEnabled(MODIFY_FS_FEATURE);
this.assertFeatureEnabled(MODIFY_FS_FEATURE);
const { remotePath } = opts ?? {};
const fullPath = resolveToAbsolutePath(remotePath);
await checkFolderExists(fullPath);
Expand Down
4 changes: 2 additions & 2 deletions lib/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class WindowsDriver extends BaseDriver {
throw new Error(`'prerun' capability value must either contain ` +
`'script' or 'command' entry of string type`);
}
this.ensureFeatureEnabled(POWER_SHELL_FEATURE);
this.assertFeatureEnabled(POWER_SHELL_FEATURE);
const output = await this.execPowerShell(caps.prerun);
if (output) {
this.log.info(`Prerun script output: ${output}`);
Expand Down Expand Up @@ -120,7 +120,7 @@ class WindowsDriver extends BaseDriver {
} else {
this.log.info('Executing postrun PowerShell script');
try {
this.ensureFeatureEnabled(POWER_SHELL_FEATURE);
this.assertFeatureEnabled(POWER_SHELL_FEATURE);
const output = await this.execPowerShell(this.opts.postrun);
if (output) {
this.log.info(`Postrun script output: ${output}`);
Expand Down

0 comments on commit 645e9e5

Please sign in to comment.