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

fix(*): add missing text check to getColumnNumber, rename function and file

This commit is contained in:
Krishna Acondy
2021-04-07 10:58:24 +01:00
parent 205bd0c8bc
commit 35cefe877d
3 changed files with 22 additions and 3 deletions

View File

@@ -0,0 +1,13 @@
import { getColumnNumber } from './getColumnNumber'
describe('getColumnNumber', () => {
it('should return the column number of the specified string within a line of text', () => {
expect(getColumnNumber('foo bar', 'bar')).toEqual(5)
})
it('should throw an error when the specified string is not found within the text', () => {
expect(() => getColumnNumber('foo bar', 'baz')).toThrowError(
"String 'baz' was not found in statement 'foo bar'"
)
})
})