prettier.js 435 B

123456789101112131415161718192021
  1. const prettierMock = {
  2. format: jest.fn().mockImplementation(input => 'formatted:' + input),
  3. resolveConfig: {
  4. sync: jest.fn().mockImplementation(file => ({ file })),
  5. },
  6. getSupportInfo: jest.fn().mockReturnValue({
  7. languages: [
  8. {
  9. name: 'JavaScript',
  10. extensions: ['.js'],
  11. },
  12. {
  13. name: 'Markdown',
  14. extensions: ['.md'],
  15. },
  16. ],
  17. }),
  18. };
  19. module.exports = prettierMock;