Skip to content

Commit f660d41

Browse files
committed
Revert "use .to.eql() instead of .to.be()"
This reverts commit 5798679.
1 parent aa33f95 commit f660d41

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

test/test.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,23 @@
5454
it('String template', function () {
5555
expect(
5656
tmpl('{%=o.value%}', data)
57-
).to.eql(
57+
).to.be(
5858
'value'
5959
);
6060
});
6161

6262
it('Load template by id', function () {
6363
expect(
6464
tmpl('template', data)
65-
).to.eql(
65+
).to.be(
6666
'value'
6767
);
6868
});
6969

7070
it('Retun function when called without data parameter', function () {
7171
expect(
7272
tmpl('{%=o.value%}')(data)
73-
).to.eql(
73+
).to.be(
7474
'value'
7575
);
7676
});
@@ -89,55 +89,55 @@
8989
it('Escape HTML special characters with {%=o.prop%}', function () {
9090
expect(
9191
tmpl('{%=o.special%}', data)
92-
).to.eql(
92+
).to.be(
9393
'<>&"''
9494
);
9595
});
9696

9797
it('Allow HTML special characters with {%#o.prop%}', function () {
9898
expect(
9999
tmpl('{%#o.special%}', data)
100-
).to.eql(
100+
).to.be(
101101
'<>&"\'\x00'
102102
);
103103
});
104104

105105
it('Function call', function () {
106106
expect(
107107
tmpl('{%=o.func()%}', data)
108-
).to.eql(
108+
).to.be(
109109
'value'
110110
);
111111
});
112112

113113
it('Dot notation', function () {
114114
expect(
115115
tmpl('{%=o.deep.value%}', data)
116-
).to.eql(
116+
).to.be(
117117
'value'
118118
);
119119
});
120120

121121
it('Handle single quotes', function () {
122122
expect(
123123
tmpl('\'single quotes\'{%=": \'"%}', data)
124-
).to.eql(
124+
).to.be(
125125
'\'single quotes\': &#39;'
126126
);
127127
});
128128

129129
it('Handle double quotes', function () {
130130
expect(
131131
tmpl('"double quotes"{%=": \\""%}', data)
132-
).to.eql(
132+
).to.be(
133133
'"double quotes": &quot;'
134134
);
135135
});
136136

137137
it('Handle backslashes', function () {
138138
expect(
139139
tmpl('\\backslashes\\{%=": \\\\"%}', data)
140-
).to.eql(
140+
).to.be(
141141
'\\backslashes\\: \\'
142142
);
143143
});
@@ -151,7 +151,7 @@
151151
'{%=o.zeroValue%}',
152152
data
153153
)
154-
).to.eql(
154+
).to.be(
155155
'false0'
156156
);
157157
});
@@ -165,7 +165,7 @@
165165
'{%#o.zeroValue%}',
166166
data
167167
)
168-
).to.eql(
168+
).to.be(
169169
'false0'
170170
);
171171
});
@@ -176,7 +176,7 @@
176176
'\n\r\t{%=o.value%} \n\r\t{%=o.value%} ',
177177
data
178178
)
179-
).to.eql(
179+
).to.be(
180180
'\n\r\tvalue \n\r\tvalue '
181181
);
182182
});
@@ -188,15 +188,15 @@
188188
it('Escape HTML special characters with print(data)', function () {
189189
expect(
190190
tmpl('{% print(o.special); %}', data)
191-
).to.eql(
191+
).to.be(
192192
'&lt;&gt;&amp;&quot;&#39;'
193193
);
194194
});
195195

196196
it('Allow HTML special characters with print(data, true)', function () {
197197
expect(
198198
tmpl('{% print(o.special, true); %}', data)
199-
).to.eql(
199+
).to.be(
200200
'<>&"\'\x00'
201201
);
202202
});
@@ -210,7 +210,7 @@
210210
'{% print(o.zeroValue); %}',
211211
data
212212
)
213-
).to.eql(
213+
).to.be(
214214
'false0'
215215
);
216216
});
@@ -224,23 +224,23 @@
224224
'{% print(o.zeroValue, true); %}',
225225
data
226226
)
227-
).to.eql(
227+
).to.be(
228228
'false0'
229229
);
230230
});
231231

232232
it('Include template', function () {
233233
expect(
234234
tmpl('{% include("template", {value: "value"}); %}', data)
235-
).to.eql(
235+
).to.be(
236236
'value'
237237
);
238238
});
239239

240240
it('If condition', function () {
241241
expect(
242242
tmpl('{% if (o.value) { %}true{% } else { %}false{% } %}', data)
243-
).to.eql(
243+
).to.be(
244244
'true'
245245
);
246246
});
@@ -251,7 +251,7 @@
251251
'{% if (o.undefinedValue) { %}false{% } else { %}true{% } %}',
252252
data
253253
)
254-
).to.eql(
254+
).to.be(
255255
'true'
256256
);
257257
});
@@ -263,7 +263,7 @@
263263
'{%=o.list[i]%}{% } %}',
264264
data
265265
)
266-
).to.eql(
266+
).to.be(
267267
'12345'
268268
);
269269
});
@@ -275,7 +275,7 @@
275275
'print(o.list[i]);} %}',
276276
data
277277
)
278-
).to.eql(
278+
).to.be(
279279
'12345'
280280
);
281281
});
@@ -287,7 +287,7 @@
287287
'include("template", {value: o.list[i]});} %}',
288288
data
289289
).replace(/[\r\n]/g, '')
290-
).to.eql(
290+
).to.be(
291291
'12345'
292292
);
293293
});
@@ -298,7 +298,7 @@
298298
'{% if (o.list.length % 5 === 0) { %}5 list items{% } %}',
299299
data
300300
).replace(/[\r\n]/g, '')
301-
).to.eql(
301+
).to.be(
302302
'5 list items'
303303
);
304304
});

0 commit comments

Comments
 (0)