Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GantMan committed Feb 4, 2018
1 parent 33b34c3 commit f9f27a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion __tests__/command_helpers/updateRequirement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ describe('updateRequirement', () => {
context.print = {
spin: jest.fn(() => spinner),
error: jest.fn(),
colors: {
green: jest.fn()
}

}
})

Expand Down Expand Up @@ -129,7 +133,7 @@ describe('updateRequirement', () => {
})[0]

const result = await updateRequirement(requirement, settings, context)
expect(result).toEqual([["Setting checkThing 'semver' to '12.0.0'"]])
expect(result).toEqual(["Setting checkThing 'semver' to '12.0.0'"])
expect(spinner.stop.mock.calls.length).toEqual(1)
})
})
Expand Down
4 changes: 2 additions & 2 deletions src/extensions/functions/updateRequirement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ module.exports = async (

// report changes
if (changes.length > 0) {
const message = print.colors.green(`Setting ${rule.name} ${changes.join(', ')}`)
spinner.succeed(message)
const message = `Setting ${rule.name} ${changes.join(', ')}`
spinner.succeed(print.colors.green(message))
return message
} else {
return []
Expand Down

0 comments on commit f9f27a7

Please sign in to comment.