From dcdb048a5af36d14bde64fa09099c9468308330f Mon Sep 17 00:00:00 2001 From: Mukul Bhutiani Date: Fri, 20 Dec 2024 02:00:28 +0530 Subject: [PATCH] core fixed --- packages/cli-exec/test/exec.test.js | 1 - packages/core/test/api.test.js | 2 ++ packages/core/test/discovery.test.js | 2 ++ packages/core/test/percy.test.js | 2 ++ packages/core/test/snapshot-multiple.test.js | 2 ++ packages/core/test/snapshot.test.js | 2 ++ packages/core/test/utils.test.js | 1 + 7 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/cli-exec/test/exec.test.js b/packages/cli-exec/test/exec.test.js index 2a2433e78..21be11f0a 100644 --- a/packages/cli-exec/test/exec.test.js +++ b/packages/cli-exec/test/exec.test.js @@ -125,7 +125,6 @@ describe('percy exec', () => { it('runs the command even when PERCY_TOKEN is missing', async () => { delete process.env.PERCY_TOKEN; - delete process.env.PERCY_FORCE_PKG_VALUE; await exec(['--', 'node', '--eval', '']); expect(logger.stderr).toEqual(jasmine.arrayContaining([ diff --git a/packages/core/test/api.test.js b/packages/core/test/api.test.js index 7cc581a3e..5f16a2ddc 100644 --- a/packages/core/test/api.test.js +++ b/packages/core/test/api.test.js @@ -14,6 +14,7 @@ describe('API Server', () => { } beforeEach(async () => { + process.env.PERCY_FORCE_PKG_VALUE = JSON.stringify({ "name": "@percy/client", "version": "1.0.0" }); await setupTest(); percy = new Percy({ @@ -25,6 +26,7 @@ describe('API Server', () => { afterEach(async () => { percy.stop.and?.callThrough(); await percy.stop(); + delete process.env.PERCY_FORCE_PKG_VALUE; }); it('has a default port', () => { diff --git a/packages/core/test/discovery.test.js b/packages/core/test/discovery.test.js index c99ba2cfe..ac79b5dd1 100644 --- a/packages/core/test/discovery.test.js +++ b/packages/core/test/discovery.test.js @@ -35,6 +35,7 @@ describe('Discovery', () => { beforeEach(async () => { captured = []; + process.env.PERCY_FORCE_PKG_VALUE = JSON.stringify({ "name": "@percy/client", "version": "1.0.0" }); await setupTest(); originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL; jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000; @@ -67,6 +68,7 @@ describe('Discovery', () => { afterEach(async () => { await percy?.stop(true); await server.close(); + delete process.env.PERCY_FORCE_PKG_VALUE; jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout; }); diff --git a/packages/core/test/percy.test.js b/packages/core/test/percy.test.js index 4f2f84b75..594af2c2b 100644 --- a/packages/core/test/percy.test.js +++ b/packages/core/test/percy.test.js @@ -8,6 +8,7 @@ describe('Percy', () => { let percy, server; beforeEach(async () => { + process.env.PERCY_FORCE_PKG_VALUE = JSON.stringify({ "name": "@percy/client", "version": "1.0.0" }); await setupTest(); server = await createTestServer({ @@ -28,6 +29,7 @@ describe('Percy', () => { await percy.stop(); await server.close(); delete process.env.PERCY_TOKEN; + delete process.env.PERCY_FORCE_PKG_VALUE; delete process.env.PERCY_CLIENT_ERROR_LOGS; delete process.env.PERCY_IGNORE_TIMEOUT_ERROR; }); diff --git a/packages/core/test/snapshot-multiple.test.js b/packages/core/test/snapshot-multiple.test.js index 8dc71b1eb..0e4a8ad05 100644 --- a/packages/core/test/snapshot-multiple.test.js +++ b/packages/core/test/snapshot-multiple.test.js @@ -7,6 +7,7 @@ describe('Snapshot multiple', () => { beforeEach(async () => { sitemap = ['/']; + process.env.PERCY_FORCE_PKG_VALUE = JSON.stringify({ "name": "@percy/client", "version": "1.0.0" }); await setupTest(); percy = await Percy.start({ @@ -32,6 +33,7 @@ describe('Snapshot multiple', () => { }); afterEach(async () => { + delete process.env.PERCY_FORCE_PKG_VALUE; await percy.stop(true); await server?.close(); }); diff --git a/packages/core/test/snapshot.test.js b/packages/core/test/snapshot.test.js index 456b9afa3..ba9401fae 100644 --- a/packages/core/test/snapshot.test.js +++ b/packages/core/test/snapshot.test.js @@ -9,6 +9,7 @@ describe('Snapshot', () => { beforeEach(async () => { testDOM = '

Test

'; + process.env.PERCY_FORCE_PKG_VALUE = JSON.stringify({ "name": "@percy/client", "version": "1.0.0" }); await setupTest(); server = await createTestServer({ @@ -33,6 +34,7 @@ describe('Snapshot', () => { afterEach(async () => { delete process.env.PERCY_CLIENT_ERROR_LOGS; + delete process.env.PERCY_FORCE_PKG_VALUE; await percy.stop(true); await server?.close(); }); diff --git a/packages/core/test/utils.test.js b/packages/core/test/utils.test.js index 3457e44dd..d39477be4 100644 --- a/packages/core/test/utils.test.js +++ b/packages/core/test/utils.test.js @@ -8,6 +8,7 @@ describe('utils', () => { beforeEach(async () => { log = percyLogger(); logger.reset(true); + process.env.PERCY_FORCE_PKG_VALUE = JSON.stringify({ "name": "@percy/client", "version": "1.0.0" }); await logger.mock({ level: 'debug' }); });