1
0
mirror of https://github.com/sasjs/lint.git synced 2025-12-11 01:44:36 +00:00
Files
lint/src/rules/line/noTabs.spec.ts

23 lines
662 B
TypeScript

import { Severity } from '../../types/Severity'
import { noTabs } from './noTabs'
describe('noTabs', () => {
it('should return an empty array when the line is not indented with a tab', () => {
const line = "%put 'hello';"
expect(noTabs.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(noTabs.test(line, 1)).toEqual([
{
message: 'Line contains a tab character (09x)',
lineNumber: 1,
startColumnNumber: 1,
endColumnNumber: 2,
severity: Severity.Warning
}
])
})
})