mirror of
https://github.com/sasjs/lint.git
synced 2025-12-10 17:34:36 +00:00
fix: styling issue
This commit is contained in:
@@ -8,20 +8,26 @@ describe('hasRequiredMacroOptions - test', () => {
|
|||||||
hasRequiredMacroOptions: true,
|
hasRequiredMacroOptions: true,
|
||||||
requiredMacroOptions: ['SECURE']
|
requiredMacroOptions: ['SECURE']
|
||||||
})
|
})
|
||||||
expect(hasRequiredMacroOptions.test(contentSecure, configSecure)).toEqual([])
|
expect(hasRequiredMacroOptions.test(contentSecure, configSecure)).toEqual(
|
||||||
|
[]
|
||||||
|
)
|
||||||
|
|
||||||
const contentSecureSrc = '%macro somemacro/ SECURE SRC;'
|
const contentSecureSrc = '%macro somemacro/ SECURE SRC;'
|
||||||
const configSecureSrc = new LintConfig({
|
const configSecureSrc = new LintConfig({
|
||||||
hasRequiredMacroOptions: true,
|
hasRequiredMacroOptions: true,
|
||||||
requiredMacroOptions: ['SECURE', 'SRC']
|
requiredMacroOptions: ['SECURE', 'SRC']
|
||||||
})
|
})
|
||||||
expect(hasRequiredMacroOptions.test(contentSecureSrc, configSecureSrc)).toEqual([])
|
expect(
|
||||||
|
hasRequiredMacroOptions.test(contentSecureSrc, configSecureSrc)
|
||||||
|
).toEqual([])
|
||||||
|
|
||||||
const configEmpty = new LintConfig({
|
const configEmpty = new LintConfig({
|
||||||
hasRequiredMacroOptions: true,
|
hasRequiredMacroOptions: true,
|
||||||
requiredMacroOptions: ['']
|
requiredMacroOptions: ['']
|
||||||
})
|
})
|
||||||
expect(hasRequiredMacroOptions.test(contentSecureSrc, configEmpty)).toEqual([])
|
expect(hasRequiredMacroOptions.test(contentSecureSrc, configEmpty)).toEqual(
|
||||||
|
[]
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should return an array with a single diagnostic when Macro does not contain the required option', () => {
|
it('should return an array with a single diagnostic when Macro does not contain the required option', () => {
|
||||||
@@ -31,7 +37,9 @@ describe('hasRequiredMacroOptions - test', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const contentMinXOperator = '%macro somemacro(var1, var2)/minXoperator;'
|
const contentMinXOperator = '%macro somemacro(var1, var2)/minXoperator;'
|
||||||
expect(hasRequiredMacroOptions.test(contentMinXOperator, configSecure)).toEqual([
|
expect(
|
||||||
|
hasRequiredMacroOptions.test(contentMinXOperator, configSecure)
|
||||||
|
).toEqual([
|
||||||
{
|
{
|
||||||
message: `Macro 'somemacro' does not contain the required option 'SECURE'`,
|
message: `Macro 'somemacro' does not contain the required option 'SECURE'`,
|
||||||
lineNumber: 1,
|
lineNumber: 1,
|
||||||
@@ -42,7 +50,9 @@ describe('hasRequiredMacroOptions - test', () => {
|
|||||||
])
|
])
|
||||||
|
|
||||||
const contentSecureSplit = '%macro somemacro(var1, var2)/ SE CURE;'
|
const contentSecureSplit = '%macro somemacro(var1, var2)/ SE CURE;'
|
||||||
expect(hasRequiredMacroOptions.test(contentSecureSplit, configSecure)).toEqual([
|
expect(
|
||||||
|
hasRequiredMacroOptions.test(contentSecureSplit, configSecure)
|
||||||
|
).toEqual([
|
||||||
{
|
{
|
||||||
message: `Macro 'somemacro' does not contain the required option 'SECURE'`,
|
message: `Macro 'somemacro' does not contain the required option 'SECURE'`,
|
||||||
lineNumber: 1,
|
lineNumber: 1,
|
||||||
@@ -53,15 +63,17 @@ describe('hasRequiredMacroOptions - test', () => {
|
|||||||
])
|
])
|
||||||
|
|
||||||
const contentNoOption = '%macro somemacro(var1, var2);'
|
const contentNoOption = '%macro somemacro(var1, var2);'
|
||||||
expect(hasRequiredMacroOptions.test(contentNoOption, configSecure)).toEqual([
|
expect(hasRequiredMacroOptions.test(contentNoOption, configSecure)).toEqual(
|
||||||
{
|
[
|
||||||
message: `Macro 'somemacro' does not contain the required option 'SECURE'`,
|
{
|
||||||
lineNumber: 1,
|
message: `Macro 'somemacro' does not contain the required option 'SECURE'`,
|
||||||
startColumnNumber: 0,
|
lineNumber: 1,
|
||||||
endColumnNumber: 0,
|
startColumnNumber: 0,
|
||||||
severity: Severity.Warning
|
endColumnNumber: 0,
|
||||||
}
|
severity: Severity.Warning
|
||||||
])
|
}
|
||||||
|
]
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should return an array with a two diagnostics when Macro does not contain the required options', () => {
|
it('should return an array with a two diagnostics when Macro does not contain the required options', () => {
|
||||||
@@ -71,7 +83,9 @@ describe('hasRequiredMacroOptions - test', () => {
|
|||||||
severityLevel: { hasRequiredMacroOptions: 'warn' }
|
severityLevel: { hasRequiredMacroOptions: 'warn' }
|
||||||
})
|
})
|
||||||
const contentMinXOperator = '%macro somemacro(var1, var2)/minXoperator;'
|
const contentMinXOperator = '%macro somemacro(var1, var2)/minXoperator;'
|
||||||
expect(hasRequiredMacroOptions.test(contentMinXOperator, configSrcStmt)).toEqual([
|
expect(
|
||||||
|
hasRequiredMacroOptions.test(contentMinXOperator, configSrcStmt)
|
||||||
|
).toEqual([
|
||||||
{
|
{
|
||||||
message: `Macro 'somemacro' does not contain the required option 'SRC'`,
|
message: `Macro 'somemacro' does not contain the required option 'SRC'`,
|
||||||
lineNumber: 1,
|
lineNumber: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user