Skip to content

support mocking modules not found in filesystem

Compare
Choose a tag to compare
@iambumblehead iambumblehead released this 25 Aug 08:51
968b357

support mocking specifiers that aren't found in filesystem re #126,

use isPackageNotFoundError: false to enable this. For example,

const component = await esmock(`../local/vueComponent.js`, {
  vue: { // vue was not downloaded and is not found in the filesystem
    h: (...args) => args
  }
}, {}, {
  isPackageNotFoundError: false
})

the interface for this may change in the near future