From e1c06e6ed3c3a23f9c64a7309424ee40d7ed1888 Mon Sep 17 00:00:00 2001 From: Anan Zhuang Date: Tue, 1 Nov 2022 16:18:47 +0000 Subject: [PATCH] Update test snapshots and fix failed test Signed-off-by: Anan Zhuang --- .../integration/failure_hooks.test.js | 1 + .../lib/mocha/filter_suites_by_tags.test.js | 26 +++++++++---------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/packages/osd-test/src/functional_test_runner/integration/failure_hooks.test.js b/packages/osd-test/src/functional_test_runner/integration/failure_hooks.test.js index 2047a6c3065f..9e565671ba5d 100644 --- a/packages/osd-test/src/functional_test_runner/integration/failure_hooks.test.js +++ b/packages/osd-test/src/functional_test_runner/integration/failure_hooks.test.js @@ -55,6 +55,7 @@ describe('failure hooks', function () { { flag: '$FAILING_TEST$', assert(lines) { + expect(lines.shift()).to.match(/\$FAILING_TEST\$/); expect(lines.shift()).to.match(/global before each/); expect(lines.shift()).to.match(/info\s+testFailure\s+\$FAILING_TEST_ERROR\$/); expect(lines.shift()).to.match(/info\s+testFailureAfterDelay\s+\$FAILING_TEST_ERROR\$/); diff --git a/packages/osd-test/src/functional_test_runner/lib/mocha/filter_suites_by_tags.test.js b/packages/osd-test/src/functional_test_runner/lib/mocha/filter_suites_by_tags.test.js index 5781a6fd785f..bc27ff7e1a8a 100644 --- a/packages/osd-test/src/functional_test_runner/lib/mocha/filter_suites_by_tags.test.js +++ b/packages/osd-test/src/functional_test_runner/lib/mocha/filter_suites_by_tags.test.js @@ -111,8 +111,8 @@ it('only runs hooks of parents and tests in level1a', async () => { "suite: ", "suite: level 1", "suite: level 1 level 1a", - "hook: \\"before each\\" hook: rootBeforeEach", - "hook: level 1 \\"before each\\" hook: level1BeforeEach", + "hook: \\"before each\\" hook: rootBeforeEach for \\"test 1a\\"", + "hook: level 1 \\"before each\\" hook: level1BeforeEach for \\"test 1a\\"", "test: level 1 level 1a test 1a", ] `); @@ -130,8 +130,8 @@ it('only runs hooks of parents and tests in level1b', async () => { "suite: ", "suite: level 1", "suite: level 1 level 1b", - "hook: \\"before each\\" hook: rootBeforeEach", - "hook: level 1 \\"before each\\" hook: level1BeforeEach", + "hook: \\"before each\\" hook: rootBeforeEach for \\"test 1b\\"", + "hook: level 1 \\"before each\\" hook: level1BeforeEach for \\"test 1b\\"", "test: level 1 level 1b test 1b", ] `); @@ -149,12 +149,12 @@ it('only runs hooks of parents and tests in level1a and level1b', async () => { "suite: ", "suite: level 1", "suite: level 1 level 1a", - "hook: \\"before each\\" hook: rootBeforeEach", - "hook: level 1 \\"before each\\" hook: level1BeforeEach", + "hook: \\"before each\\" hook: rootBeforeEach for \\"test 1a\\"", + "hook: level 1 \\"before each\\" hook: level1BeforeEach for \\"test 1a\\"", "test: level 1 level 1a test 1a", "suite: level 1 level 1b", - "hook: \\"before each\\" hook: rootBeforeEach", - "hook: level 1 \\"before each\\" hook: level1BeforeEach", + "hook: \\"before each\\" hook: rootBeforeEach for \\"test 1b\\"", + "hook: level 1 \\"before each\\" hook: level1BeforeEach for \\"test 1b\\"", "test: level 1 level 1b test 1b", ] `); @@ -173,8 +173,8 @@ it('only runs level1a if including level1 and excluding level1b', async () => { "suite: ", "suite: level 1", "suite: level 1 level 1a", - "hook: \\"before each\\" hook: rootBeforeEach", - "hook: level 1 \\"before each\\" hook: level1BeforeEach", + "hook: \\"before each\\" hook: rootBeforeEach for \\"test 1a\\"", + "hook: level 1 \\"before each\\" hook: level1BeforeEach for \\"test 1a\\"", "test: level 1 level 1a test 1a", ] `); @@ -193,8 +193,8 @@ it('only runs level1b if including level1 and excluding level1a', async () => { "suite: ", "suite: level 1", "suite: level 1 level 1b", - "hook: \\"before each\\" hook: rootBeforeEach", - "hook: level 1 \\"before each\\" hook: level1BeforeEach", + "hook: \\"before each\\" hook: rootBeforeEach for \\"test 1b\\"", + "hook: level 1 \\"before each\\" hook: level1BeforeEach for \\"test 1b\\"", "test: level 1 level 1b test 1b", ] `); @@ -212,7 +212,7 @@ it('only runs level2 if excluding level1', async () => { "suite: ", "suite: level 2", "suite: level 2 level 2a", - "hook: \\"before each\\" hook: rootBeforeEach", + "hook: \\"before each\\" hook: rootBeforeEach for \\"test 2a\\"", "test: level 2 level 2a test 2a", ] `);