Skip to content

Commit

Permalink
chore(*): separate tests for test and fix functions
Browse files Browse the repository at this point in the history
  • Loading branch information
krishna-acondy committed Apr 21, 2021
1 parent 3da3e1e commit 2687a8f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/rules/file/hasDoxygenHeader.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { LintConfig } from '../../types'
import { Severity } from '../../types/Severity'
import { hasDoxygenHeader } from './hasDoxygenHeader'

describe('hasDoxygenHeader', () => {
describe('hasDoxygenHeader - test', () => {
it('should return an empty array when the file starts with a doxygen header', () => {
const content = `/**
@file
Expand Down Expand Up @@ -69,7 +69,9 @@ describe('hasDoxygenHeader', () => {
}
])
})
})

describe('hasDoxygenHeader - fix', () => {
it('should not alter the text if a doxygen header is already present', () => {
const content = `/**
@file
Expand Down
4 changes: 3 additions & 1 deletion src/rules/file/hasMacroNameInMend.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { LintConfig } from '../../types'
import { Severity } from '../../types/Severity'
import { hasMacroNameInMend } from './hasMacroNameInMend'

describe('hasMacroNameInMend', () => {
describe('hasMacroNameInMend - test', () => {
it('should return an empty array when %mend has correct macro name', () => {
const content = `
%macro somemacro();
Expand Down Expand Up @@ -339,7 +339,9 @@ describe('hasMacroNameInMend', () => {
}
])
})
})

describe('hasMacroNameInMend - fix', () => {
it('should add macro name to the mend statement if not present', () => {
const content = ` %macro somemacro;\n %put &sysmacroname;\n %mend;`
const expectedContent = ` %macro somemacro;\n %put &sysmacroname;\n %mend somemacro;`
Expand Down
4 changes: 3 additions & 1 deletion src/rules/file/lineEndings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { LintConfig, Severity } from '../../types'
import { LineEndings } from '../../types/LineEndings'
import { lineEndings } from './lineEndings'

describe('lineEndings', () => {
describe('lineEndings - test', () => {
it('should return an empty array when the text contains the configured line endings', () => {
const text = "%put 'hello';\n%put 'world';\n"
const config = new LintConfig({ lineEndings: LineEndings.LF })
Expand Down Expand Up @@ -101,7 +101,9 @@ describe('lineEndings', () => {
severity: Severity.Warning
})
})
})

describe('lineEndings - fix', () => {
it('should transform line endings to LF', () => {
const text =
"%put 'hello';\r\n%put 'test';\r\n%put 'world';\n%put 'test2';\n%put 'world2';\r\n"
Expand Down

0 comments on commit 2687a8f

Please sign in to comment.