Skip to content

Commit

Permalink
simplify testing output
Browse files Browse the repository at this point in the history
  • Loading branch information
termosa committed Jul 1, 2018
1 parent ce7789d commit c1b8a57
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions __tests__/guide.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ const mockInquirer = (() => {
return inquirer
})()
jest.mock('inquirer', () => mockInquirer)

const mockChalkFormatter = str => str
jest.mock('chalk', () => ({
blueBright: mockChalkFormatter,
gray: mockChalkFormatter
}))

const guide = require('../lib/guide')

const commands = [
Expand Down Expand Up @@ -56,7 +63,7 @@ describe('Guide', () => {
name: 'command',
message: 'Choose command:',
type: 'list',
prefix: '\u001b[94m[GO]\u001b[39m',
prefix: '[GO]',
choices: [
{
disabled: false,
Expand Down Expand Up @@ -84,7 +91,7 @@ describe('Guide', () => {
},
{
disabled: true,
name: 'name 2\u001b[90m — desc 2\u001b[39m',
name: 'name 2 — desc 2',
short: 'name 2',
value: {
name: 'name 2',
Expand All @@ -99,7 +106,7 @@ describe('Guide', () => {
name: 'command',
message: 'Choose command:',
type: 'list',
prefix: '\u001b[94m[NAME 0]\u001b[39m',
prefix: '[NAME 0]',
choices: [
{
disabled: false,
Expand All @@ -126,7 +133,7 @@ describe('Guide', () => {
name: 'command',
message: 'deep',
type: 'list',
prefix: '\u001b[94m[NAME 0.1]\u001b[39m',
prefix: '[NAME 0.1]',
choices: [
{
disabled: false,
Expand Down

0 comments on commit c1b8a57

Please sign in to comment.