Skip to content

Commit a8a7059

Browse files
committed
Code review
1 parent 0ab9888 commit a8a7059

3 files changed

Lines changed: 5 additions & 10 deletions

File tree

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ describe('Basic Expect Matchers available when pulling expect from expect-webdri
7676
it('should match object properties', async () => {
7777
const capabilities = await browser.capabilities
7878

79-
console.log('capabilities', expect(capabilities).toHaveProperty('browserName'))
8079
await expect(capabilities).toHaveProperty('browserName')
8180
await expect(capabilities).toMatchObject({
8281
browserName: 'chrome'

playgrounds/jest/jest.setup.after-env.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ import { matchers } from "expect-webdriverio";
66
jest.setTimeout(30000);
77

88
beforeAll(async () => {
9-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
10-
expect.extend(matchers as Record<string, any>);
9+
// Ad custom wdio matcher to Jest's expect
10+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
11+
expect.extend(matchers as Record<string, any>);
1112

12-
// The enhanced expect already has matchers extended, no need to extend again
13-
globalThis.standalone = await remote(config);
14-
console.log('Browser session started with sessionId:', globalThis.standalone.sessionId);
13+
globalThis.standalone = await remote(config);
1514
});
1615

1716
afterAll(async () => {
18-
console.log('Ending browser session with sessionId:', globalThis.standalone?.sessionId);
19-
await globalThis.standalone?.deleteSession();
17+
await globalThis.standalone?.deleteSession();
2018
});

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
describe('Basic Expect Matchers', () => {
22
beforeEach(async () => {
3-
console.log('Navigating to WebdriverIO homepage', standalone)
43
await standalone.url('https://webdriver.io')
54
await expect(standalone).toHaveTitle('WebdriverIO', { containing: true })
65
})
@@ -9,7 +8,6 @@ describe('Basic Expect Matchers', () => {
98
it('should verify truthy values', async () => {
109
const element = await standalone.$('.navbar')
1110
const isDisplayed = await element.isDisplayed()
12-
console.log('expect', expect)
1311
expect(isDisplayed).toBe(true)
1412
expect(isDisplayed).toBeTruthy()
1513
})

0 commit comments

Comments
 (0)