Files
2026-07-13 12:22:50 +08:00

21 lines
558 B
JavaScript

// Import the mocked module
jest.mock('../src/utils/keepAwake');
import {activateKeepAwake, deactivateKeepAwake} from '../src/utils/keepAwake';
describe('keepAwake', () => {
beforeEach(() => {
// Clear all mocks before each test
jest.clearAllMocks();
});
it('should call activate on the native module', () => {
activateKeepAwake();
expect(activateKeepAwake).toHaveBeenCalled();
});
it('should call deactivate on the native module', () => {
deactivateKeepAwake();
expect(deactivateKeepAwake).toHaveBeenCalled();
});
});