core icon indicating copy to clipboard operation
core copied to clipboard

module.appendLibrary produces different results from module.extend.toTest.appendLibrary

Open zoe-codez opened this issue 1 year ago • 0 comments

🐜 Bug description

Version 1

createModule
  .fromLibrary(LIB_EXAMPLE)
  .appendLibrary(
    CreateLibrary({
      name: "test",
      services: {
        // ...
      }
    })
  )
  .extend()
  .toTest()

Version 2

createModule
  .fromLibrary(LIB_EXAMPLE)
  .extend()
  .toTest()
  .appendLibrary(
    CreateLibrary({
      name: "test",
      services: {
        // ...
      }
    })
  )

These two do not prioritize the same when it comes to bootstrapping things. Version 1 will allow for spies to be inserted against other libraries before LIB_EXAMPLE gets loaded. Version 2 will construct AFTER LIB_EXAMPLE, preventing tests of construction logic

Related

testRunner.setup(...) appears to follow the prioritization of Version 2, which similarly prevents access to construction tests

zoe-codez avatar Oct 06 '24 15:10 zoe-codez