Skip to content

Commit

Permalink
fix(packagers): set SLS_DEBUG for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kennyhyun committed May 24, 2024
1 parent c4999d7 commit 32a6b9f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/packagers/npm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,17 @@ jest.mock('../../lib/utils', () => {
});

describe('npm', () => {
const ENV = process.env;

beforeAll(() => {
process.env = { ...ENV, SLS_DEBUG: '*' };
});
beforeEach(() => {
fsMock.readFileSync.mockReturnValue(false);
});
afterAll(() => {
process.env = ENV;
});

it('should return "package-lock.json" as lockfile name', () => {
expect(npmModule.lockfileName).toEqual('package-lock.json');
Expand Down
9 changes: 9 additions & 0 deletions tests/packagers/yarn.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ jest.mock('../../lib/utils', () => {
});

describe('yarn', () => {
const ENV = process.env;

beforeAll(() => {
process.env = { ...ENV, SLS_DEBUG: '*' };
});
afterAll(() => {
process.env = ENV;
});

it('should return "yarn.lock" as lockfile name', () => {
expect(yarnModule.lockfileName).toEqual('yarn.lock');
});
Expand Down

0 comments on commit 32a6b9f

Please sign in to comment.