mirror of
https://github.com/sasjs/server.git
synced 2025-12-10 19:34:34 +00:00
34 lines
774 B
TypeScript
34 lines
774 B
TypeScript
import { parseLogToArray } from '../parseLogToArray'
|
|
|
|
describe('parseLogToArray', () => {
|
|
it('should parse log to array type', () => {
|
|
const log = parseLogToArray(`
|
|
line 1 of log content
|
|
line 2 of log content
|
|
line 3 of log content
|
|
line 4 of log content
|
|
`)
|
|
|
|
expect(log).toEqual([
|
|
{ line: '' },
|
|
{ line: 'line 1 of log content' },
|
|
{ line: 'line 2 of log content' },
|
|
{ line: 'line 3 of log content' },
|
|
{ line: 'line 4 of log content' },
|
|
{ line: ' ' }
|
|
])
|
|
})
|
|
|
|
it('should parse log to array type if empty', () => {
|
|
const log = parseLogToArray('')
|
|
|
|
expect(log).toEqual([])
|
|
})
|
|
|
|
it('should parse log to array type if not provided', () => {
|
|
const log = parseLogToArray()
|
|
|
|
expect(log).toEqual([])
|
|
})
|
|
})
|