mirror of
https://github.com/sasjs/lint.git
synced 2026-01-09 05:20:06 +00:00
feat(lint): implement v1 with 3 rules - trailing spaces, encoded passwords and Doxygen header
This commit is contained in:
19
src/rules/noTrailingSpaces.spec.ts
Normal file
19
src/rules/noTrailingSpaces.spec.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { noTrailingSpaces } from './noTrailingSpaces'
|
||||
|
||||
describe('noTrailingSpaces', () => {
|
||||
it('should return an empty array when the line has no trailing spaces', () => {
|
||||
const line = "%put 'hello';"
|
||||
expect(noTrailingSpaces.test(line, 1)).toEqual([])
|
||||
})
|
||||
|
||||
it('should return an array with a single diagnostic when the line has trailing spaces', () => {
|
||||
const line = "%put 'hello'; "
|
||||
expect(noTrailingSpaces.test(line, 1)).toEqual([
|
||||
{
|
||||
warning: 'Line contains trailing spaces',
|
||||
lineNumber: 1,
|
||||
columnNumber: 14
|
||||
}
|
||||
])
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user