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

fix(*): Add severity, start and end column numbers for diagnostics, change warning to message

This commit is contained in:
Krishna Acondy
2021-03-24 09:11:09 +00:00
parent 702756545b
commit de1fabc394
12 changed files with 126 additions and 37 deletions

View File

@@ -1,3 +1,4 @@
import { Severity } from '../types/Severity'
import { noEncodedPasswords } from './noEncodedPasswords'
describe('noEncodedPasswords', () => {
@@ -10,9 +11,11 @@ describe('noEncodedPasswords', () => {
const line = "%put '{SASENC}'; "
expect(noEncodedPasswords.test(line, 1)).toEqual([
{
warning: 'Line contains encoded password',
message: 'Line contains encoded password',
lineNumber: 1,
columnNumber: 7
startColumnNumber: 7,
endColumnNumber: 15,
severity: Severity.Error
}
])
})
@@ -21,9 +24,11 @@ describe('noEncodedPasswords', () => {
const line = "%put '{SAS001}'; "
expect(noEncodedPasswords.test(line, 1)).toEqual([
{
warning: 'Line contains encoded password',
message: 'Line contains encoded password',
lineNumber: 1,
columnNumber: 7
startColumnNumber: 7,
endColumnNumber: 15,
severity: Severity.Error
}
])
})
@@ -32,14 +37,18 @@ describe('noEncodedPasswords', () => {
const line = "%put '{SAS001} {SAS002}'; "
expect(noEncodedPasswords.test(line, 1)).toEqual([
{
warning: 'Line contains encoded password',
message: 'Line contains encoded password',
lineNumber: 1,
columnNumber: 7
startColumnNumber: 7,
endColumnNumber: 15,
severity: Severity.Error
},
{
warning: 'Line contains encoded password',
message: 'Line contains encoded password',
lineNumber: 1,
columnNumber: 16
startColumnNumber: 16,
endColumnNumber: 24,
severity: Severity.Error
}
])
})