Skip to content

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

@zoe-codez

Description

@zoe-codez

🐜 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions