Skip to content

Commit ce962d2

Browse files
committed
maint(core basepattern): Use identity instead equality comaprison instead in tests for stricter testing.
1 parent c32bf26 commit ce962d2

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/core/basepattern.test.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ describe("Basepattern class tests", function () {
2525
// trigger and name are static and available on the class itself
2626
expect(Pat.name).toBe("example");
2727
expect(Pat.trigger).toBe(".example");
28-
expect(typeof Pat.parser.parse).toEqual("function");
28+
expect(typeof Pat.parser.parse).toBe("function");
2929

3030
const el = document.createElement("div");
3131

3232
const pat = new Pat(el);
3333
await utils.timeout(1);
3434

35-
expect(pat.name).toEqual("example");
36-
expect(pat.trigger).toEqual(".example");
37-
expect(typeof pat.parser.parse).toEqual("function");
35+
expect(pat.name).toBe("example");
36+
expect(pat.trigger).toBe(".example");
37+
expect(typeof pat.parser.parse).toBe("function");
3838
});
3939

4040
it("2 - Base pattern is class based and does inheritance, polymorphism, encapsulation, ... pt1", async function () {
@@ -61,13 +61,13 @@ describe("Basepattern class tests", function () {
6161

6262
expect(pat1 instanceof Pat1).toBe(true);
6363
expect(pat1 instanceof Pat2).toBe(false);
64-
expect(pat1.el).toEqual(el1);
65-
expect(pat1.some).toEqual("thing");
64+
expect(pat1.el).toBe(el1);
65+
expect(pat1.some).toBe("thing");
6666

6767
expect(pat2 instanceof Pat1).toBe(true);
6868
expect(pat2 instanceof Pat2).toBe(true);
69-
expect(pat2.el).toEqual(el2);
70-
expect(pat2.some).toEqual("other");
69+
expect(pat2.el).toBe(el2);
70+
expect(pat2.some).toBe("other");
7171
});
7272

7373
it("3 - can be extended multiple times", async function () {
@@ -95,23 +95,23 @@ describe("Basepattern class tests", function () {
9595
const pat3 = new Pat3(el);
9696
await utils.timeout(1);
9797

98-
expect(pat1.name).toEqual("example1");
99-
expect(pat1.something).toEqual("else");
100-
expect(pat1.some).toEqual(undefined);
98+
expect(pat1.name).toBe("example1");
99+
expect(pat1.something).toBe("else");
100+
expect(pat1.some).toBe(undefined);
101101
expect(pat1 instanceof BasePattern).toBeTruthy();
102102
expect(pat1 instanceof Pat2).toBeFalsy();
103103
expect(pat1 instanceof Pat3).toBeFalsy();
104104

105-
expect(pat2.name).toEqual("example2");
106-
expect(pat2.something).toEqual("else");
107-
expect(pat2.some).toEqual("thing2");
105+
expect(pat2.name).toBe("example2");
106+
expect(pat2.something).toBe("else");
107+
expect(pat2.some).toBe("thing2");
108108
expect(pat2 instanceof BasePattern).toBeTruthy();
109109
expect(pat2 instanceof Pat1).toBeTruthy();
110110
expect(pat2 instanceof Pat3).toBeFalsy();
111111

112-
expect(pat3.name).toEqual("example3");
113-
expect(pat3.something).toEqual("else");
114-
expect(pat3.some).toEqual("thing3");
112+
expect(pat3.name).toBe("example3");
113+
expect(pat3.something).toBe("else");
114+
expect(pat3.some).toBe("thing3");
115115
expect(pat3 instanceof BasePattern).toBeTruthy();
116116
expect(pat3 instanceof Pat1).toBeTruthy();
117117
expect(pat3 instanceof Pat2).toBeTruthy();
@@ -126,7 +126,7 @@ describe("Basepattern class tests", function () {
126126
const pat = new Pat(el);
127127
await utils.timeout(1);
128128

129-
expect(el["pattern-example"]).toEqual(pat);
129+
expect(el["pattern-example"]).toBe(pat);
130130
});
131131

132132
it("5 - Registers with the registry.", async function () {

0 commit comments

Comments
 (0)