Skip to content

Commit

Permalink
core fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mucool1205 committed Dec 19, 2024
1 parent ff0eb6a commit dcdb048
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 1 deletion.
1 change: 0 additions & 1 deletion packages/cli-exec/test/exec.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
2 changes: 2 additions & 0 deletions packages/core/test/api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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', () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/core/test/discovery.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
});

Expand Down
2 changes: 2 additions & 0 deletions packages/core/test/percy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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;
});
Expand Down
2 changes: 2 additions & 0 deletions packages/core/test/snapshot-multiple.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -32,6 +33,7 @@ describe('Snapshot multiple', () => {
});

afterEach(async () => {
delete process.env.PERCY_FORCE_PKG_VALUE;
await percy.stop(true);
await server?.close();
});
Expand Down
2 changes: 2 additions & 0 deletions packages/core/test/snapshot.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ describe('Snapshot', () => {

beforeEach(async () => {
testDOM = '<p>Test</p>';
process.env.PERCY_FORCE_PKG_VALUE = JSON.stringify({ "name": "@percy/client", "version": "1.0.0" });
await setupTest();

server = await createTestServer({
Expand All @@ -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();
});
Expand Down
1 change: 1 addition & 0 deletions packages/core/test/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' });
});

Expand Down

0 comments on commit dcdb048

Please sign in to comment.