@vizzly-testing/cli 0.22.0 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.js +6 -3
- package/dist/reporter/reporter-bundle.iife.js +29 -29
- package/dist/sdk/index.js +1 -0
- package/dist/server/handlers/api-handler.js +5 -2
- package/dist/server/handlers/tdd-handler.js +5 -2
- package/dist/server/routers/screenshot.js +6 -4
- package/dist/utils/browser.js +2 -2
- package/dist/utils/image-input-detector.js +62 -32
- package/package.json +2 -2
package/dist/client/index.js
CHANGED
|
@@ -188,7 +188,9 @@ function createSimpleClient(serverUrl) {
|
|
|
188
188
|
try {
|
|
189
189
|
// If it's a string, assume it's a file path and send directly
|
|
190
190
|
// Otherwise it's a Buffer, so convert to base64
|
|
191
|
-
|
|
191
|
+
let isFilePath = typeof imageBuffer === 'string';
|
|
192
|
+
let image = isFilePath ? imageBuffer : imageBuffer.toString('base64');
|
|
193
|
+
let type = isFilePath ? 'file-path' : 'base64';
|
|
192
194
|
const {
|
|
193
195
|
status,
|
|
194
196
|
json
|
|
@@ -196,6 +198,7 @@ function createSimpleClient(serverUrl) {
|
|
|
196
198
|
buildId: getBuildId(),
|
|
197
199
|
name,
|
|
198
200
|
image,
|
|
201
|
+
type,
|
|
199
202
|
properties: options,
|
|
200
203
|
fullPage: options.fullPage || false
|
|
201
204
|
}, DEFAULT_TIMEOUT_MS);
|
|
@@ -356,8 +359,8 @@ export function isVizzlyReady() {
|
|
|
356
359
|
* @param {boolean} [config.enabled] - Enable/disable screenshots
|
|
357
360
|
*/
|
|
358
361
|
export function configure(config = {}) {
|
|
359
|
-
if (config
|
|
360
|
-
currentClient = createSimpleClient(config.serverUrl);
|
|
362
|
+
if ('serverUrl' in config) {
|
|
363
|
+
currentClient = config.serverUrl ? createSimpleClient(config.serverUrl) : null;
|
|
361
364
|
}
|
|
362
365
|
if (typeof config.enabled === 'boolean') {
|
|
363
366
|
setVizzlyEnabled(config.enabled);
|