Skip to content

Commit

Permalink
test: Added test for simple and advanced config object
Browse files Browse the repository at this point in the history
  • Loading branch information
okonet committed Jan 30, 2017
1 parent a9046e2 commit 9a602c4
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/generateTasks.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,33 @@ const linters = {
}

describe('generateTasks', () => {
it('should work with simple configuration', () => {
const result = generateTasks({
'*.js': 'lint'
}, {
'test.js': '/root/test.js'
})
const commands = result.map(match => match.commands)
expect(commands).toEqual([
'lint'
])
})

it('should work with advanced configuration', () => {
const result = generateTasks({
gitDir: '../',
linters: {
'*.js': 'lint'
}
}, {
'test.js': '/root/test.js'
})
const commands = result.map(match => match.commands)
expect(commands).toEqual([
'lint'
])
})

it('should return only linters it could find files for', () => {
const result = generateTasks(linters, files)
const commands = result.map(match => match.commands)
Expand Down

0 comments on commit 9a602c4

Please sign in to comment.