Skip to content

Commit

Permalink
test: specify merge conflict style for snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
iiroj committed Apr 20, 2022
1 parent a118817 commit e01c4c5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@ describe('lint-staged', () => {
})

it('should handle merge conflicts', async () => {
await execGit(['config', 'merge.conflictstyle', 'merge'])

const fileInBranchA = `module.exports = "foo";\n`
const fileInBranchB = `module.exports = 'bar'\n`
const fileInBranchBFixed = `module.exports = "bar";\n`
Expand Down Expand Up @@ -561,6 +563,8 @@ describe('lint-staged', () => {
})

it('should handle merge conflict when task errors', async () => {
await execGit(['config', 'merge.conflictstyle', 'merge'])

const fileInBranchA = `module.exports = "foo";\n`
const fileInBranchB = `module.exports = 'bar'\n`
const fileInBranchBFixed = `module.exports = "bar";\n`
Expand Down Expand Up @@ -1000,6 +1004,8 @@ describe('lint-staged', () => {
})

it('should abort commit without reverting with --no-stash 1', async () => {
await execGit(['config', 'merge.conflictstyle', 'merge'])

// Stage file
await appendFile('test.js', testJsFileUgly)
await execGit(['add', 'test.js'])
Expand Down

0 comments on commit e01c4c5

Please sign in to comment.