Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
fix: fixed description on spec
Browse files Browse the repository at this point in the history
  • Loading branch information
vzamanillo authored and Víctor Zamanillo committed Jul 3, 2019
1 parent cf1ab43 commit b759091
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spec/linter-rubocop-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import tmp from 'tmp'
import * as path from 'path'
import {
// eslint-disable-next-line no-unused-vars
it, fit, wait, beforeEach, afterEach,
it, fit, wait, beforeEach, afterEach, expectAsync,
} from 'jasmine-fix'
import { copyFileSync } from 'fs'

Expand Down Expand Up @@ -75,10 +75,11 @@ describe('The RuboCop provider for Linter', () => {
+ '(Using Ruby 2.3 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)'

const messages = await lint(editor)
const description = await messages[0].description()

expect(messages[0].severity).toBe('error')
expect(messages[0].excerpt).toBe(msgText)
expect(messages[0].description).not.toBeDefined()
expect(description).toBe('')
expect(messages[0].location.file).toBe(badPath)
expect(messages[0].location.position).toEqual([[1, 6], [1, 7]])
})
Expand Down Expand Up @@ -119,14 +120,15 @@ describe('The RuboCop provider for Linter', () => {
const msgText = 'Metrics/AbcSize: Assignment Branch Condition size for defaults is too high. [18.25/15]'

const messages = await lint(editor)
const description = await messages[0].description()

// We skip the position test because Rubocop versions before 0.52.0 returns
// a different length for the offense
expect(messages[0].severity).toBe('info')
expect(messages[0].excerpt).toBe(msgText)
expect(messages[0].url).toMatch(urlRegex)
expect(messages[0].location.file).toBe(abcSizePath)
expect(messages[0].description).not.toBeDefined()
expect(description).toBe('')
})
})

Expand Down

0 comments on commit b759091

Please sign in to comment.