showing results for - "jest serializes to the same string"
Andrés
04 May 2018
1describe("toDate", () => {
2  it("should accept times", () => {
3    const dateTime = new Date();
4    dateTime.setHours(0);
5    dateTime.setMinutes(30);
6    dateTime.setSeconds(0, 0);
7    
8    // error: serializes to same string
9    expect(toDate("00:30:00)).toBe(dateTime)
10    
11    // pass
12    expect(toDate("00:30:00")).toMatchObject(dateTime);
13  });
14});
15
16describe("array matches", () => {
17  it("should match", () => {
18  	// fail
19  	expect([0,0,0]).toBe([0, 0, 0]);
20  	// pass
21    expect([0,0,0]).toEqual([0, 0, 0]);
22    expect([0,0,0]).toStrictEqual([0, 0, 0]);
23  });
24});
25
26