From cb978848d9a6bd1a2acfedeb693da6315c0d5d96 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Tue, 27 Jul 2021 10:37:18 -0700 Subject: [PATCH] test(test runner): check custom reporter with .only tests (#7862) --- tests/playwright-test/reporter.spec.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/playwright-test/reporter.spec.ts b/tests/playwright-test/reporter.spec.ts index 23b23d8a89..ef153fb88c 100644 --- a/tests/playwright-test/reporter.spec.ts +++ b/tests/playwright-test/reporter.spec.ts @@ -84,7 +84,11 @@ test('should work with custom reporter', async ({ runInlineTest }) => { `, 'a.test.ts': ` const { test } = pwt; - test('pass', async ({}) => { + test('not run', async ({}) => { + console.log('log'); + console.error('error'); + }); + test.only('is run', async ({}) => { console.log('log'); console.error('error'); }); @@ -94,18 +98,18 @@ test('should work with custom reporter', async ({ runInlineTest }) => { expect(result.exitCode).toBe(0); expect(result.output.split('\n').filter(line => line.startsWith('%%'))).toEqual([ '%%reporter-begin-begin%%', - '%%reporter-testbegin-pass-foo%%', + '%%reporter-testbegin-is run-foo%%', '%%reporter-stdout%%', '%%reporter-stderr%%', - '%%reporter-testend-pass-foo%%', - '%%reporter-testbegin-pass-foo%%', + '%%reporter-testend-is run-foo%%', + '%%reporter-testbegin-is run-foo%%', '%%reporter-stdout%%', '%%reporter-stderr%%', - '%%reporter-testend-pass-foo%%', - '%%reporter-testbegin-pass-bar%%', + '%%reporter-testend-is run-foo%%', + '%%reporter-testbegin-is run-bar%%', '%%reporter-stdout%%', '%%reporter-stderr%%', - '%%reporter-testend-pass-bar%%', + '%%reporter-testend-is run-bar%%', '%%reporter-end-end%%', ]); });