1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | 1x 1x 1x 1x 1x 1x 1x 8x 1x 1x 1x | /* global jest */ const axios = require('axios') const gitmojiApiClient = axios.create({ baseURL: 'https://raw.githubusercontent.com/carloscuesta/gitmoji/master', timeout: 5000, headers: {}, params: {} }) const prompts = { gitmoji: ':zap:', title: 'Improving performance issues.', message: 'Refactored code.', reference: '5' } const promptsJira = { gitmoji: ':zap:', title: 'Improving performance issues.', message: 'Refactored code.', reference: 'ABC-123' } const gitmojis = [ { emoji: '⚡️', code: ':zap:', description: '', name: 'zap' } ] const invalidTitleMessageChar = '`' const commands = [ 'commit', 'config', 'hook', 'init', 'list', 'remove', 'search', 'update' ] const cliMock = (options) => ({ flags: { commit: options.commit || false, config: options.config || false, hook: options.hook || false, init: options.init || false, list: options.list || false, remove: options.remove || false, search: options.search || false, update: options.update || false }, showHelp: jest.fn() }) const optionsMock = { commit: jest.fn(), config: jest.fn(), hook: jest.fn(), init: jest.fn(), list: jest.fn(), remove: jest.fn(), search: jest.fn(), update: jest.fn() } const titleMaxLength = 48 module.exports = { cliMock, commands, gitmojiApiClient, gitmojis, invalidTitleMessageChar, optionsMock, prompts, promptsJira, titleMaxLength } |