JSPM

  • Created
  • Published
  • Downloads 34447
  • Score
    100M100P100Q144882F
  • License MIT

esmock

Package Exports

  • esmock

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (esmock) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

esmock

(c)Bumblehead

Build Status

import test from 'ava';
import esmock from 'esmock';

test('should mock module and local file at the same time', async t => {
  const main = await esmock('./local/main.js', {
    'astringifierpackage' : o => JSON.stringify(o),
    './local/util.js' : {
      exportedFunction : () => 'foobar'
    }
  });

  t.is(main(), 'foobar, ' + JSON.stringify({ test: 'object' }));
});