Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update deprecated method name #284

Merged
merged 1 commit into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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