From 1ff7d68d142ace4f2222038f7e5d4d13c3125efa Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 7 Dec 2021 13:57:49 -0700 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Michael Dokolin --- .../screenshotting/server/plugin.test.ts | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/x-pack/plugins/screenshotting/server/plugin.test.ts b/x-pack/plugins/screenshotting/server/plugin.test.ts index 8bc476380a9ce..ea61164cbc83f 100644 --- a/x-pack/plugins/screenshotting/server/plugin.test.ts +++ b/x-pack/plugins/screenshotting/server/plugin.test.ts @@ -16,9 +16,7 @@ import { install } from './browsers/install'; let initContext: PluginInitializerContext; let coreSetup: CoreSetup; let coreStart: CoreStart; -let setupDeps: { - screenshotMode: ScreenshotModePluginSetup; -}; +let setupDeps: Parameters[1]; beforeEach(() => { const configSchema = { @@ -35,17 +33,15 @@ beforeEach(() => { test('sets up and starts properly', async () => { const plugin = new ScreenshottingPlugin(initContext); const setupContract = plugin.setup(coreSetup, setupDeps); - expect(setupContract).toMatchInlineSnapshot(`Object {}`); + expect(setupContract).toEqual({}); await coreSetup.getStartServices(); const startContract = plugin.start(coreStart); - expect(startContract).toMatchInlineSnapshot(` - Object { - "diagnose": [Function], - "getScreenshots": [Function], - } - `); + expect(startContract).toEqual(expect.objectContaining({ + diagnose: expect.any(Function), + getScreenshots: expect.any(Function), + })); }); test('handles setup issues', async () => { @@ -58,10 +54,8 @@ test('handles setup issues', async () => { await coreSetup.getStartServices(); const startContract = plugin.start(coreStart); - expect(startContract).toMatchInlineSnapshot(` - Object { - "diagnose": [Function], - "getScreenshots": [Function], - } - `); + expect(startContract).toEqual(expect.objectContaining({ + diagnose: expect.any(Function), + getScreenshots: expect.any(Function), + })); });