1
0
mirror of https://github.com/sasjs/lint.git synced 2026-01-07 04:30:05 +00:00

feat(lint): implement v1 with 3 rules - trailing spaces, encoded passwords and Doxygen header

This commit is contained in:
Krishna Acondy
2021-03-22 20:23:10 +00:00
parent f3d7d38984
commit bf23963127
31 changed files with 5603 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
import { noEncodedPasswords } from './noEncodedPasswords'
describe('noEncodedPasswords', () => {
it('should return an empty array when the line has no encoded passwords', () => {
const line = "%put 'hello';"
expect(noEncodedPasswords.test(line, 1)).toEqual([])
})
it('should return an array with a single diagnostic when the line has an encoded password', () => {
const line = "%put '{SAS001}'; "
expect(noEncodedPasswords.test(line, 1)).toEqual([
{
warning: 'Line contains encoded password',
lineNumber: 1,
columnNumber: 7
}
])
})
it('should return an array with multiple diagnostics when the line has encoded passwords', () => {
const line = "%put '{SAS001} {SAS002}'; "
expect(noEncodedPasswords.test(line, 1)).toEqual([
{
warning: 'Line contains encoded password',
lineNumber: 1,
columnNumber: 7
},
{
warning: 'Line contains encoded password',
lineNumber: 1,
columnNumber: 16
}
])
})
})