Skip to content

Commit 2400886

Browse files
committed
fix attribute that can be null in playgrounds
1 parent c542164 commit 2400886

6 files changed

Lines changed: 6 additions & 6 deletions

File tree

playgrounds/jasmine/package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

playgrounds/jasmine/test/specs/basic-matchers.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ describe('Basic Expect Matchers', () => {
5252
const navLinks = await $$('nav a')
5353
const hrefs: string[] = []
5454
for (const link of navLinks) {
55-
hrefs.push(await link.getAttribute('href'))
55+
const href = await link.getAttribute('href')
56+
if(href) hrefs.push(href)
5657
}
5758

5859
await expect(hrefs).toBeInstanceOf(Array)

playgrounds/jasmine/test/specs/jasmine-specific.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ describe('Jasmine-Specific Features', () => {
3838
const navLinks = await $$('nav a')
3939
const hrefs: string[] = []
4040
for (const link of navLinks) {
41-
hrefs.push(await link.getAttribute('href'))
41+
const href = await link.getAttribute('href')
42+
if(href) hrefs.push(href)
4243
}
4344
await expect(hrefs).toEqual(jasmine.arrayContaining(['/docs/gettingstarted']))
4445
})

playgrounds/jest/package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

playgrounds/mocha/package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

playgrounds/mocha/test/specs/basic-matchers.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ describe('Basic Expect Matchers', () => {
5050
const navLinks = await $$('nav a')
5151
const hrefs: string[] = []
5252
for (const link of navLinks) {
53-
hrefs.push(await link.getAttribute('href'))
53+
const href = await link.getAttribute('href')
54+
if(href) hrefs.push(href)
5455
}
5556

5657
expect(hrefs).toBeInstanceOf(Array)

0 commit comments

Comments
 (0)