UNPKG

@testwizard/commands-video

Version:

25 lines (18 loc) 721 B
'use strict'; const Commands = require('@testwizard/commands-core'); const Result = require('./FindPatternResult'); class FindPatternCommand extends Commands.CommandBase { constructor(testObject) { super(testObject, 'FindPattern'); } async execute(filePath, mode) { if (filePath === undefined) throw new Error('filePath is required'); if (mode === undefined) throw new Error('mode is required'); const requestObj = [filePath, mode]; const json = await this.executeCommand(requestObj); return new Result(json, 'findPattern was successful', 'findPattern failed'); } } module.exports = FindPatternCommand;