From f8e84222fc1b1f6df210309e9edceabca1ac0d20 Mon Sep 17 00:00:00 2001 From: sunil-lakshman <104969541+sunil-lakshman@users.noreply.github.com> Date: Tue, 8 Apr 2025 22:47:04 +0530 Subject: [PATCH] Fix: initialize live_preview config before setting properties in Live Preview tests --- test/config.js | 2 +- test/live-preview/live-preview-test.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/config.js b/test/config.js index 6f5088f2..0cea9c0c 100755 --- a/test/config.js +++ b/test/config.js @@ -1,7 +1,7 @@ 'use strict'; require('dotenv').config(); -const requiredVars = ['HOST', 'EMAIL', 'PASSWORD', 'ORGANIZATION', 'API_KEY']; +const requiredVars = ['HOST', 'API_KEY', 'DELIVERY_TOKEN', 'ENVIRONMENT']; const missingVars = requiredVars.filter((key) => !process.env[key]); if (missingVars.length > 0) { diff --git a/test/live-preview/live-preview-test.js b/test/live-preview/live-preview-test.js index 6685e8cb..808e75d2 100644 --- a/test/live-preview/live-preview-test.js +++ b/test/live-preview/live-preview-test.js @@ -18,6 +18,7 @@ describe('Contentstack Live Preview Tests', () => { }); test('should check host when live preview is enabled and management token is provided', () => { + init.stack.live_preview = init.stack.live_preview || {}; init.stack.live_preview.enable = true; init.stack.live_preview.management_token = 'management_token'; const stack = Contentstack.Stack(init.stack);