mirror of
https://github.com/sasjs/lint.git
synced 2025-12-10 17:34:36 +00:00
28 lines
1.0 KiB
TypeScript
28 lines
1.0 KiB
TypeScript
import { Severity } from '../types/Severity'
|
|
import { lowerCaseFileNames } from './lowerCaseFileNames'
|
|
|
|
describe('lowerCaseFileNames', () => {
|
|
it('should return an empty array when the file name has no uppercase characters', () => {
|
|
const filePath = '/code/sas/my_sas_file.sas'
|
|
expect(lowerCaseFileNames.test(filePath)).toEqual([])
|
|
})
|
|
|
|
it('should return an empty array when the file name has no uppercase characters, even if the containing folder has uppercase characters', () => {
|
|
const filePath = '/code/SAS Projects/my_sas_file.sas'
|
|
expect(lowerCaseFileNames.test(filePath)).toEqual([])
|
|
})
|
|
|
|
it('should return an array with a single diagnostic when the file name has uppercase characters', () => {
|
|
const filePath = '/code/sas/my SAS file.sas'
|
|
expect(lowerCaseFileNames.test(filePath)).toEqual([
|
|
{
|
|
message: 'File name contains uppercase characters',
|
|
lineNumber: 1,
|
|
startColumnNumber: 1,
|
|
endColumnNumber: 1,
|
|
severity: Severity.Warning
|
|
}
|
|
])
|
|
})
|
|
})
|