diff --git a/aio/content/examples/toh-pt2/e2e/src/app.e2e-spec.ts b/aio/content/examples/toh-pt2/e2e/src/app.e2e-spec.ts index b4a8f2fa11b..57da530bc2a 100644 --- a/aio/content/examples/toh-pt2/e2e/src/app.e2e-spec.ts +++ b/aio/content/examples/toh-pt2/e2e/src/app.e2e-spec.ts @@ -74,7 +74,7 @@ function selectHeroTests() { it(`has selected ${targetHero.name}`, async () => { const page = getPageElts(); const expectedText = `${targetHero.id} ${targetHero.name}`; - expect((await page.selected.getText()).replace('\n', ' ')).toBe(expectedText); + expect((await page.selected.getText()).replace(/\n/g, ' ')).toBe(expectedText); }); it('shows selected hero details', async () => { @@ -101,7 +101,7 @@ function updateHeroTests() { it(`shows updated hero name in list`, async () => { const page = getPageElts(); - const hero = Hero.fromString((await page.selected.getText()).replace('\n', ' ')); + const hero = Hero.fromString((await page.selected.getText()).replace(/\n/g, ' ')); const newName = targetHero.name + nameSuffix; expect(hero.id).toEqual(targetHero.id); expect(hero.name).toEqual(newName); diff --git a/aio/content/examples/toh-pt3/e2e/src/app.e2e-spec.ts b/aio/content/examples/toh-pt3/e2e/src/app.e2e-spec.ts index 0c65e0fddf1..f7f2db0cf52 100644 --- a/aio/content/examples/toh-pt3/e2e/src/app.e2e-spec.ts +++ b/aio/content/examples/toh-pt3/e2e/src/app.e2e-spec.ts @@ -74,7 +74,7 @@ function selectHeroTests() { it(`has selected ${targetHero.name}`, async () => { const page = getPageElts(); const expectedText = `${targetHero.id} ${targetHero.name}`; - expect((await page.selected.getText()).replace('\n', ' ')).toBe(expectedText); + expect((await page.selected.getText()).replace(/\n/g, ' ')).toBe(expectedText); }); it('shows selected hero details', async () => { @@ -101,7 +101,7 @@ function updateHeroTests() { it(`shows updated hero name in list`, async () => { const page = getPageElts(); - const hero = Hero.fromString(await (await page.selected.getText()).replace('\n', ' ')); + const hero = Hero.fromString(await (await page.selected.getText()).replace(/\n/g, ' ')); const newName = targetHero.name + nameSuffix; expect(hero.id).toEqual(targetHero.id); expect(hero.name).toEqual(newName); diff --git a/aio/content/examples/toh-pt4/e2e/src/app.e2e-spec.ts b/aio/content/examples/toh-pt4/e2e/src/app.e2e-spec.ts index 252dc2a8b2f..977fdc2ffdd 100644 --- a/aio/content/examples/toh-pt4/e2e/src/app.e2e-spec.ts +++ b/aio/content/examples/toh-pt4/e2e/src/app.e2e-spec.ts @@ -74,7 +74,7 @@ function selectHeroTests() { it(`has selected ${targetHero.name}`, async () => { const page = getPageElts(); const expectedText = `${targetHero.id} ${targetHero.name}`; - expect((await page.selected.getText()).replace('\n', ' ')).toBe(expectedText); + expect((await page.selected.getText()).replace(/\n/g, ' ')).toBe(expectedText); }); it('shows selected hero details', async () => { @@ -106,7 +106,7 @@ function updateHeroTests() { it(`shows updated hero name in list`, async () => { const page = getPageElts(); - const hero = Hero.fromString((await page.selected.getText()).replace('\n', ' ')); + const hero = Hero.fromString((await page.selected.getText()).replace(/\n/g, ' ')); const newName = targetHero.name + nameSuffix; expect(hero.id).toEqual(targetHero.id); expect(hero.name).toEqual(newName); diff --git a/aio/scripts/test-external-urls.js b/aio/scripts/test-external-urls.js index 7e89375e378..ecb13b3abfa 100644 --- a/aio/scripts/test-external-urls.js +++ b/aio/scripts/test-external-urls.js @@ -64,7 +64,7 @@ const contributorsFilePath = join(__dirname, '../content/marketing/contributors. // the page is working as expected as linkedin.com returns a `999` status for // non-browser based requests. Other pages returning a `999` may still indicate an // error in the request for the page. - if ([405, 999].includes(result.status) && url.hostname.includes('linkedin.com')) { + if ([405, 999].includes(result.status) && url.hostname === 'linkedin.com') { return; }