Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
jest.mock replaced with spyOn 2 (#3898)
Browse files Browse the repository at this point in the history
  • Loading branch information
adoroshk authored Aug 30, 2023
1 parent 1e9603e commit 8782c53
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/terra-alert/tests/jest/Alert.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Alert from '../../src/Alert';

let mockSpyUuid;
beforeAll(() => {
mockSpyUuid = jest.spyOn(uuidv4, 'v4').mockImplementation(() => '00000000-0000-0000-0000-000000000000');
mockSpyUuid = jest.spyOn(uuidv4, 'v4').mockReturnValue('00000000-0000-0000-0000-000000000000');
});

afterAll(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ let mockSpyUuid;

// using a variable may result in failures. For best results, mock return value.
beforeAll(() => {
mockSpyUuid = jest.spyOn(uuidv4, 'v4').mockImplementation(() => '00000000-0000-0000-0000-000000000000');
mockSpyUuid = jest.spyOn(uuidv4, 'v4').mockReturnValue('00000000-0000-0000-0000-000000000000');
});

// restore the mock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ let mockSpyUuid;

// using a variable may result in failures. For best results, mock return value.
beforeAll(() => {
mockSpyUuid = jest.spyOn(uuidv4, 'v4').mockImplementation(() => '00000000-0000-0000-0000-000000000000');
mockSpyUuid = jest.spyOn(uuidv4, 'v4').mockReturnValue('00000000-0000-0000-0000-000000000000');
});

// restore the mock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ let mockSpyUuid;

// using a variable may result in failures. For best results, mock return value.
beforeAll(() => {
mockSpyUuid = jest.spyOn(uuidv4, 'v4').mockImplementation(() => '00000000-0000-0000-0000-000000000000');
mockSpyUuid = jest.spyOn(uuidv4, 'v4').mockReturnValue('00000000-0000-0000-0000-000000000000');
});

// restore the mock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Fieldset from '../../src/Fieldset';

let mockSpyUuid;
beforeAll(() => {
mockSpyUuid = jest.spyOn(uuidv4, 'v4').mockImplementation(() => '00000000-0000-0000-0000-000000000000');
mockSpyUuid = jest.spyOn(uuidv4, 'v4').mockReturnValue('00000000-0000-0000-0000-000000000000');
});

afterAll(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/terra-show-hide/tests/jest/ShowHide.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import ShowHide from '../../src/ShowHide';
describe('ShowHide', () => {
let mockSpyUuid;
beforeAll(() => {
mockSpyUuid = jest.spyOn(uuidv4, 'v4').mockImplementation(() => '00000000-0000-0000-0000-000000000000');
mockSpyUuid = jest.spyOn(uuidv4, 'v4').mockReturnValue('00000000-0000-0000-0000-000000000000');
});

afterAll(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ShowHideFocuser from '../../src/ShowHideFocuser';
describe('ShowHideFocuser', () => {
let mockSpyUuid;
beforeAll(() => {
mockSpyUuid = jest.spyOn(uuidv4, 'v4').mockImplementation(() => '00000000-0000-0000-0000-000000000000');
mockSpyUuid = jest.spyOn(uuidv4, 'v4').mockReturnValue('00000000-0000-0000-0000-000000000000');
});

afterAll(() => {
Expand Down

0 comments on commit 8782c53

Please sign in to comment.