Skip to content

Commit 4c0d444

Browse files
committed
this commit will update the processLogHelper test, specifically the makeArrayOfObjects test to be formatted according to the expected data, and more expansive in assertions
1 parent d33db55 commit 4c0d444

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

__tests__/ProcessLogHelper.test.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,19 @@ import {
99
import {describe, beforeEach,afterEach, expect, test} from '@jest/globals';
1010

1111
describe('makeArrayOfObjects', () => {
12-
test('returns an array', () => {
13-
const string = `HelloZ from Docker!
14-
15-
This message shows that your installation appears to be working correctly.
16-
12+
test('returns a result array with appropriately constructed object elements', () => {
13+
const string2 = `2022-12-22T19:36:44.564948926Z 2022/12/22 19:36:44 [notice] 1#1: start worker process 22\n2022-12-22T20:12:01.081323805Z 2022/12/22 20:12:01 [notice] 22#22: gracefully shutting down
1714
`;
18-
const result = makeArrayOfObjects(string);
15+
16+
const result = makeArrayOfObjects(string2);
17+
console.log(result);
1918
expect(result).toBeInstanceOf(Array);
2019
expect(result.length).toEqual(2);
2120
expect(result.containerName).toBe(undefined);
22-
expect(result[0].logMsg).toEqual('HelloZ from Docker!');
23-
expect(result[0].timeStamp).toBeUndefined();
21+
expect(result[0].logMsg).toEqual('1#1: start worker process 22');
22+
expect(result[0].timeStamp).toBe('12/22/2022, 1:36:44 PM');
23+
expect(result[1].logMsg).toEqual('22#22: gracefully shutting down');
24+
expect(result[1].timeStamp).toBe('12/22/2022, 2:12:01 PM');
2425
});
2526

2627
// Can be addressed through TS

0 commit comments

Comments
 (0)