import { mockLoggingSystem } from './config_deprecation.test.mocks' ; import { loggingSystemMock } from '../../logging/logging_system.mock' ; import * as osdTestServer from '../../../test_helpers/osd_server' ; describe ( 'configuration deprecations' , ( ) => { let root ; beforeEach ( ( ) => { jest . clearAllMocks ( ) ; } ) ; afterEach ( async ( ) => { if ( root ) { await root . shutdown ( ) ; } } ) ; it ( 'should not log deprecation warnings for default configuration' , async ( ) => { root = osdTestServer . createRoot ( ) ; await root . setup ( ) ; const logs = loggingSystemMock . collect ( mockLoggingSystem ) ; expect ( logs . warn . flat ( ) ) . toMatchInlineSnapshot ( `Array []` ) ; } ) ; it ( 'should log deprecation warnings for core deprecations' , async ( ) => { root = osdTestServer . createRoot ( { optimize : { lazy : true , lazyPort : 9090 , } , } ) ; await root . setup ( ) ; const logs = loggingSystemMock . collect ( mockLoggingSystem ) ; expect ( logs . warn . flat ( ) ) . toMatchInlineSnapshot ( `
      Array [
        "optimize.lazy is deprecated and is no longer used",
        "optimize.lazyPort is deprecated and is no longer used",
      ]
    ` ) ; } ) ; } ) ;