execa.js 400 B

12345678910111213141516171819202122
  1. const mockStream = () => ({
  2. once: jest.fn(),
  3. on: jest.fn(),
  4. removeListener: jest.fn(),
  5. pipe: jest.fn(),
  6. });
  7. const mockExeca = jest.fn().mockReturnValue({
  8. stdout: mockStream(),
  9. stderr: mockStream(),
  10. kill: () => {},
  11. });
  12. const mockExecaSync = jest.fn().mockReturnValue({
  13. stdout: '',
  14. stderr: '',
  15. kill: () => {},
  16. });
  17. module.exports = mockExeca;
  18. module.exports.sync = mockExecaSync;