Skip to content

Commit c53640d

Browse files
jaydinsweosidharthachatterjee
authored andcommitted
tests(gatsby-transformer-remark): make equality checks stricter (#16524)
1 parent c1c85b9 commit c53640d

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

packages/gatsby-transformer-remark/src/__tests__/extend-node.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Where oh where is my little pony?`,
134134
`,
135135
node => {
136136
expect(node).toMatchSnapshot()
137-
expect(node.excerpt).toMatch(`Where oh where is my little pony?`)
137+
expect(node.excerpt).toBe(`Where oh where is my little pony?`)
138138
expect(node.excerptAst).toMatchObject({
139139
children: [
140140
{
@@ -169,7 +169,7 @@ date: "2017-09-18T23:19:51.246Z"
169169
`,
170170
node => {
171171
expect(node).toMatchSnapshot()
172-
expect(node.excerpt).toMatch(``)
172+
expect(node.excerpt).toBe(``)
173173
expect(node.excerptAst).toMatchObject({
174174
children: [],
175175
data: { quirksMode: false },
@@ -198,7 +198,7 @@ In quis lectus sed eros efficitur luctus. Morbi tempor, nisl eget feugiat tincid
198198
`,
199199
node => {
200200
expect(node).toMatchSnapshot()
201-
expect(node.excerpt).toMatch(`Where oh where is my little pony?`)
201+
expect(node.excerpt).toBe(`Where oh where is my little pony?`)
202202
expect(node.excerptAst).toMatchObject({
203203
children: [
204204
{
@@ -241,7 +241,7 @@ In quis lectus sed eros efficitur luctus. Morbi tempor, nisl eget feugiat tincid
241241
`excerpt(format: PLAIN)`,
242242
node => {
243243
expect(node).toMatchSnapshot()
244-
expect(node.excerpt).toMatch(`Where oh where is my little pony?`)
244+
expect(node.excerpt).toBe(`Where oh where is my little pony?`)
245245
},
246246
{ pluginOptions: { excerpt_separator: `<!-- end -->` } }
247247
)
@@ -252,8 +252,8 @@ In quis lectus sed eros efficitur luctus. Morbi tempor, nisl eget feugiat tincid
252252
`excerpt(format: HTML)`,
253253
node => {
254254
expect(node).toMatchSnapshot()
255-
expect(node.excerpt).toMatch(
256-
`<p>Where oh where <strong>is</strong> my little pony?</p>`
255+
expect(node.excerpt).toBe(
256+
`<p>Where oh where <strong>is</strong> my little pony?</p>\n`
257257
)
258258
},
259259
{ pluginOptions: { excerpt_separator: `<!-- end -->` } }
@@ -265,7 +265,7 @@ In quis lectus sed eros efficitur luctus. Morbi tempor, nisl eget feugiat tincid
265265
`excerpt(format: MARKDOWN)`,
266266
node => {
267267
expect(node).toMatchSnapshot()
268-
expect(node.excerpt).toMatch(`Where oh where **is** my little pony?`)
268+
expect(node.excerpt).toBe(`Where oh where **is** my little pony?\n`)
269269
},
270270
{ pluginOptions: { excerpt_separator: `<!-- end -->` } }
271271
)
@@ -407,7 +407,7 @@ Where oh [*where*](nick.com) **_is_** ![that pony](pony.png)?`,
407407
`,
408408
node => {
409409
expect(node).toMatchSnapshot()
410-
expect(node.excerpt).toMatch(
410+
expect(node.excerpt).toBe(
411411
`<p>Where oh <a href="nick.com"><em>where</em></a> <strong><em>is</em></strong> <img src="pony.png" alt="that pony">?</p>`
412412
)
413413
expect(node.excerptAst).toMatchObject({
@@ -503,7 +503,7 @@ Where oh [*where*](nick.com) **_is_** ![that pony](pony.png)?`,
503503
}
504504
`,
505505
node => {
506-
expect(node.excerpt).toMatch(`Where oh where is that pony?`)
506+
expect(node.excerpt).toBe(`Where oh where is that pony?`)
507507
},
508508
{}
509509
)
@@ -518,7 +518,7 @@ date: "2017-09-18T23:19:51.246Z"
518518
My pony likes space on the left and right! `,
519519
`excerpt`,
520520
node => {
521-
expect(node.excerpt).toMatch(`My pony likes space on the left and right!`)
521+
expect(node.excerpt).toBe(`My pony likes space on the left and right!`)
522522
},
523523
{}
524524
)
@@ -535,7 +535,7 @@ My pony is little.
535535
Little is my pony.`,
536536
`excerpt`,
537537
node => {
538-
expect(node.excerpt).toMatch(`My pony is little. Little is my pony.`)
538+
expect(node.excerpt).toBe(`My pony is little. Little is my pony.`)
539539
},
540540
{}
541541
)
@@ -554,7 +554,7 @@ date: "2017-09-18T23:19:51.246Z"
554554
It's pony time.`,
555555
`excerpt`,
556556
node => {
557-
expect(node.excerpt).toMatch(
557+
expect(node.excerpt).toBe(
558558
`Ponies: The Definitive Guide What time is it? It's pony time.`
559559
)
560560
},
@@ -573,7 +573,7 @@ date: "2017-09-18T23:19:51.246Z"
573573
| My Little Pony | Me, Duh |`,
574574
`excerpt`,
575575
node => {
576-
expect(node.excerpt).toMatch(`Pony Owner My Little Pony Me, Duh`)
576+
expect(node.excerpt).toBe(`Pony Owner My Little Pony Me, Duh`)
577577
},
578578
{}
579579
)
@@ -590,7 +590,7 @@ don't fix it.`,
590590
// ^ Explicit syntax for trailing spaces to not get accidentally trimmed.
591591
`excerpt`,
592592
node => {
593-
expect(node.excerpt).toMatch(`If my pony ain't broke, don't fix it.`)
593+
expect(node.excerpt).toBe(`If my pony ain't broke, don't fix it.`)
594594
},
595595
{}
596596
)
@@ -609,7 +609,7 @@ date: "2017-09-18T23:19:51.246Z"
609609
Pony express had nothing on my little pony.`,
610610
`excerpt`,
611611
node => {
612-
expect(node.excerpt).toMatch(
612+
expect(node.excerpt).toBe(
613613
`Pony express Pony express had nothing on my little pony.`
614614
)
615615
},
@@ -632,7 +632,7 @@ Where is my <code>pony</code> named leo?`,
632632
`,
633633
node => {
634634
expect(node).toMatchSnapshot()
635-
expect(node.excerpt).toMatch(
635+
expect(node.excerpt).toBe(
636636
`<p>Where is my <code>pony</code> named leo?</p>`
637637
)
638638
expect(node.excerptAst).toMatchObject({
@@ -687,7 +687,7 @@ Where oh where is that pony? Is he in the stable or down by the stream?`,
687687
`,
688688
node => {
689689
expect(node).toMatchSnapshot()
690-
expect(node.excerpt).toMatch(
690+
expect(node.excerpt).toBe(
691691
`<p>Where oh where is that pony? Is he in the stable…</p>`
692692
)
693693
expect(node.excerptAst).toMatchObject({
@@ -730,8 +730,8 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi auctor sit amet v
730730
`,
731731
node => {
732732
expect(node).toMatchSnapshot()
733-
expect(node.excerpt).toMatch(
734-
`<p>Where oh where is that <em>pony</em>? Is he in the stable or by the stream?</p>`
733+
expect(node.excerpt).toBe(
734+
`<p>Where oh where is that <em>pony</em>? Is he in the stable or by the stream?</p>\n`
735735
)
736736
expect(node.excerptAst).toMatchObject({
737737
children: [

0 commit comments

Comments
 (0)