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:
35
src/rules/noEncodedPasswords.spec.ts
Normal file
35
src/rules/noEncodedPasswords.spec.ts
Normal 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
|
||||
}
|
||||
])
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user