test(images): skip images plugin unit tests which require opencv, if opencv is not available the rationale is that folks developing plugins other than this one shouldn't need to go through the pain of opencv4nodejs setup. CI will catch any regressions in unit tests for this particular plugin.
MODIFY
packages/appium-plugins/packages/images/test/unit/plugin-specs.js
packages/appium-plugins/packages/images/test/unit/plugin-specs.js
+let hasOpenCV = false;
+try {
+ require('opencv4nodejs');
+ hasOpenCV = true;
+} catch (ign) {}
+
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import ImageElementPlugin, { IMAGE_STRATEGY } from '../../index';
@@ -9,7 +15,9 @@ import { TEST_IMG_1_B64, TEST_IMG_2_B64, TEST_IMG_2_PART_B64 } from '../fixtures
chai.use(chaiAsPromised);
chai.should();
-describe('ImageElementPlugin#handle', function () {
+const describeOrSkip = hasOpenCV ? describe : describe.skip;
+
+describeOrSkip('ImageElementPlugin#handle', function () {
const next = () => {};
const driver = new BaseDriver();
const p = new ImageElementPlugin();

test(images): skip images plugin unit tests which require opencv, if opencv is not available the rationale is that folks developing plugins other than this one shouldn't need to go through the pain of opencv4nodejs setup. CI will catch any regressions in unit tests for this particular plugin.