1
0
mirror of https://github.com/sasjs/lint.git synced 2025-12-10 17:34:36 +00:00
Files
lint/src/rules/line/noTabIndentation.spec.ts
2021-04-07 16:34:33 +01:00

23 lines
694 B
TypeScript

import { Severity } from '../../types/Severity'
import { noTabIndentation } from './noTabIndentation'
describe('noTabs', () => {
it('should return an empty array when the line is not indented with a tab', () => {
const line = "%put 'hello';"
expect(noTabIndentation.test(line, 1)).toEqual([])
})
it('should return an array with a single diagnostic when the line is indented with a tab', () => {
const line = "\t%put 'hello';"
expect(noTabIndentation.test(line, 1)).toEqual([
{
message: 'Line is indented with a tab',
lineNumber: 1,
startColumnNumber: 1,
endColumnNumber: 1,
severity: Severity.Warning
}
])
})
})