Skip to content

Commit

Permalink
✅ Upgrade specs to new behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
steelbrain committed Jul 18, 2016
1 parent 972bf2b commit 61cc287
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions spec/helper-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const somethingFile = path.join(__dirname, 'fixtures', 'something.js')
const packageJsonPath = fs.realpathSync(`${__dirname}/../package.json`)

describe('linter helpers', function () {
describe('::rangeFromLineNumber', function () {
fdescribe('::rangeFromLineNumber', function () {
it('cries when invalid textEditor is passed', () =>
expect(() =>
helpers.rangeFromLineNumber()
Expand All @@ -23,18 +23,18 @@ describe('linter helpers', function () {
waitsForAsync(async function () {
await atom.workspace.open(somethingFile)
const textEditor = atom.workspace.getActiveTextEditor()
expect(helpers.rangeFromLineNumber(textEditor)).toEqual([[0, 0], [0, 7]])
expect(helpers.rangeFromLineNumber(textEditor, -1)).toEqual([[0, 0], [0, 7]])
expect(helpers.rangeFromLineNumber(textEditor, 'a')).toEqual([[0, 0], [0, 7]])
expect(helpers.rangeFromLineNumber(textEditor)).toEqual([[0, 0], [0, 30]])
expect(helpers.rangeFromLineNumber(textEditor, -1)).toEqual([[0, 0], [0, 30]])
expect(helpers.rangeFromLineNumber(textEditor, 'a')).toEqual([[0, 0], [0, 30]])
})
)

it('ignores an invalid starting column', () =>
waitsForAsync(async function () {
await atom.workspace.open(somethingFile)
const textEditor = atom.workspace.getActiveTextEditor()
expect(helpers.rangeFromLineNumber(textEditor, 7, -1)).toEqual([[7, 0], [7, 2]])
expect(helpers.rangeFromLineNumber(textEditor, 7, 'a')).toEqual([[7, 0], [7, 2]])
expect(helpers.rangeFromLineNumber(textEditor, 7, -1)).toEqual([[7, 0], [7, 43]])
expect(helpers.rangeFromLineNumber(textEditor, 7, 'a')).toEqual([[7, 0], [7, 43]])
})
)

Expand All @@ -43,7 +43,7 @@ describe('linter helpers', function () {
await atom.workspace.open(somethingFile)
const textEditor = atom.workspace.getActiveTextEditor()
const range = helpers.rangeFromLineNumber(textEditor, 7)
expect(range).toEqual([[7, 0], [7, 2]])
expect(range).toEqual([[7, 0], [7, 43]])
})
)

Expand Down

0 comments on commit 61cc287

Please sign in to comment.