Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Comments
  • Loading branch information
JamesNK committed Aug 14, 2024
commit e5f0a7e6791b018aea7c0be2defeb99f3ee86599
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const JestPuppeteerEnvironment = require("jest-environment-puppeteer").TestEnvironment;

// expect-puppeteer requires jest's expect to be on the global object
// expect-puppeteer requires jest's expect to be on the global object.
// If the global object isn't populated then there is a null reference error in expect-puppeteer.
global.expect = require('expect').expect;
const expect = require('expect-puppeteer').expect;

Expand All @@ -9,8 +10,7 @@ class CustomEnvironment extends JestPuppeteerEnvironment {
async setup() {
await super.setup();

// Workaround puppeteer bug
// https://github.com/argos-ci/jest-puppeteer/issues/586
// Workaround puppeteer bug: https://github.com/argos-ci/jest-puppeteer/issues/586
if (this.global.context.isIncognito === undefined) {
this.global.context.isIncognito = () => false;
}
Expand All @@ -20,10 +20,10 @@ class CustomEnvironment extends JestPuppeteerEnvironment {
var page = this.global.page;
await page.goto('http://localhost:8081', { waitUntil: 'networkidle0' });

// Wait for Blazor to finish loading
// Wait for Blazor to finish loading.
await expect(page).toMatchTextContent('gRPC-Web interop tests');

// Get test names
// Get test names.
this.global.__GRPC_WEB_TEST_NAMES__ = await page.evaluate(() => getTestNames('GrpcWeb'));
this.global.__GRPC_WEB_TEXT_TEST_NAMES__ = await page.evaluate(() => getTestNames('GrpcWebText'));
}
Expand Down