# Snapshot report for `test/function.js`

The actual snapshot is saved in `function.js.snap`.

Generated by [AVA](https://avajs.dev).

## assign-properties-to-default-export

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var foo$1 = {exports: {}};␊
      ␊
      const foo = {};␊
      ␊
      foo$1.exports = foo;␊
      foo$1.exports.bar = 1;␊
      ␊
      t.is(foo$1.exports.bar, 1);␊
      `,
    }

## assumed-globals

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var document$1 = {exports: {}};␊
      ␊
      /* eslint-disable */␊
      ␊
      if (typeof document !== 'undefined') {␊
        document$1.exports = document;␊
      } else {␊
        document$1.exports = { fake: true };␊
      }␊
      ␊
      t.deepEqual(document$1.exports, { real: true });␊
      `,
    }

## bare-import

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      Math.bar = 42;␊
      ␊
      t.is(Math.bar, 42);␊
      `,
    }

## bare-import-comment

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      // Great module␊
      Math.bar = 42;␊
      ␊
      t.is(Math.bar, 42);␊
      `,
    }

## basic

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var foo$1 = 21;␊
      ␊
      const foo = foo$1;␊
      ␊
      var main = foo * 2;␊
      ␊
      module.exports = main;␊
      `,
    }

## call-non-local-function-semantics

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var platform$1 = {};␊
      ␊
      platform$1.use = (platform) => (platform$1.platform = platform);␊
      ␊
      var browser$1 = 'browser';␊
      ␊
      var proxy = {};␊
      ␊
      var hasRequiredProxy;␊
      ␊
      function requireProxy () {␊
      	if (hasRequiredProxy) return proxy;␊
      	hasRequiredProxy = 1;␊
      	const { platform } = platform$1;␊
      ␊
      	t.is(platform, 'browser');␊
      	return proxy;␊
      }␊
      ␊
      // simplified from dd-trace␊
      const platform = platform$1;␊
      const browser = browser$1;␊
      ␊
      platform.use(browser);␊
      ␊
      requireProxy();␊
      ␊
      module.exports = main;␊
      `,
    }

## circular-dependencies

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      Object.defineProperty(exports, '__esModule', { value: true });␊
      ␊
      var main$1 = {};␊
      ␊
      var dep$1 = {};␊
      ␊
      const main = main$1;␊
      ␊
      dep$1.getMain = () => main;␊
      ␊
      const dep = dep$1;␊
      ␊
      var foo = main$1.foo = 'foo';␊
      t.is(dep.getMain().foo, 'foo');␊
      ␊
      exports["default"] = main$1;␊
      exports.foo = foo;␊
      `,
    }

## circular-dependencies-wrapped

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      Object.defineProperty(exports, '__esModule', { value: true });␊
      ␊
      var main = {};␊
      ␊
      var dep = {};␊
      ␊
      (function (exports) {␊
      	const main$1 = main;␊
      ␊
      	addExports(exports);␊
      ␊
      	function addExports(exported) {␊
      	  // eslint-disable-next-line no-param-reassign␊
      	  exported.getMain = () => main$1;␊
      	}␊
      } (dep));␊
      ␊
      (function (exports) {␊
      	const dep$1 = dep;␊
      ␊
      	addExports();␊
      	t.is(dep$1.getMain().foo, 'foo');␊
      ␊
      	function addExports(exported) {␊
      	  // eslint-disable-next-line no-param-reassign␊
      	  exports.foo = 'foo';␊
      	}␊
      } (main));␊
      ␊
      exports["default"] = main;␊
      `,
    }

## cjs-extension

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var _export = {␊
        test: 42␊
      };␊
      ␊
      const { test } = _export;␊
      ␊
      t.is(test, 42);␊
      ␊
      module.exports = main;␊
      `,
    }

## conditional-require-chain

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      var main = {};␊
      ␊
      var dep = {};␊
      ␊
      var throws = {};␊
      ␊
      var hasRequiredThrows;␊
      ␊
      function requireThrows () {␊
      	if (hasRequiredThrows) return throws;␊
      	hasRequiredThrows = 1;␊
      	throw new Error('This should not be executed');␊
      }␊
      ␊
      var hasRequiredDep;␊
      ␊
      function requireDep () {␊
      	if (hasRequiredDep) return dep;␊
      	hasRequiredDep = 1;␊
      	requireThrows();␊
      	return dep;␊
      }␊
      ␊
      commonjsGlobal.false = false;␊
      ␊
      if (commonjsGlobal.false) {␊
        // eslint-disable-next-line global-require␊
        requireDep();␊
      }␊
      ␊
      module.exports = main;␊
      `,
    }

## conditional-require-non-strict

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      var main = {};␊
      ␊
      commonjsGlobal.foo = true;␊
      ␊
      commonjsGlobal.bar = true;␊
      ␊
      commonjsGlobal.main = true;␊
      ␊
      t.is(commonjsGlobal.foo, true, 'foo');␊
      t.is(commonjsGlobal.main, true, 'main');␊
      ␊
      module.exports = main;␊
      `,
    }

## custom-options

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      t.is('main', 'main');␊
      `,
    }

## dash-name

> Snapshot 1

    {
      'bundle.js': `'use strict';␊
      ␊
      var dashName = true;␊
      ␊
      t.truthy(dashName);␊
      `,
    }

## deconflict-export-and-local

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var someValue$1 = {};␊
      ␊
      someValue$1.someValue = 10;␊
      ␊
      const someValueModule = someValue$1;␊
      ␊
      var someValue = someValueModule.someValue;␊
      ␊
      t.is(someValue, 10);␊
      `,
    }

## dot

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var foo_bar = 'fubar';␊
      ␊
      const status = foo_bar;␊
      ␊
      t.is(status, 'fubar');␊
      ␊
      module.exports = main;␊
      `,
    }

## double-exports-assignment

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var dep = {};␊
      ␊
      dep.foo = 'first';␊
      dep.foo = 'second';␊
      ␊
      t.is(dep.foo, 'second');␊
      `,
    }

## double-exports-assignment-named

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var foo = 'first';␊
      foo = 'second';␊
      ␊
      t.is(foo, 'second');␊
      `,
    }

## double-module-exports-assignment

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var dep = 'first';␊
      dep = 'second';␊
      ␊
      var dep$1 = dep;␊
      ␊
      t.is(dep$1, 'second');␊
      `,
    }

## duplicate-default-exports

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var x$1 = {exports: {}};␊
      ␊
      const x = {};␊
      ␊
      x$1.exports = x;␊
      x$1.exports.default = x;␊
      ␊
      t.is(x$1.exports.default, x$1.exports);␊
      `,
    }

## duplicate-default-exports-b

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var x$1 = {exports: {}};␊
      ␊
      const x = {};␊
      ␊
      x$1.exports = x;␊
      x$1.exports.default = 42;␊
      ␊
      t.deepEqual(x$1.exports, { default: 42 });␊
      `,
    }

## duplicate-default-exports-c

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var exports$1 = {};␊
      ␊
      var Foo = exports$1.Foo = 1;␊
      var _var = exports$1.var = 'VAR';␊
      exports$1.default = {␊
        Foo: 2,␊
        default: 3␊
      };␊
      ␊
      /* eslint-disable */␊
      ␊
      t.is(exports$1.Foo, 1);␊
      t.is(exports$1.var, 'VAR');␊
      t.deepEqual(exports$1.default, { Foo: 2, default: 3 });␊
      t.is(exports$1.default.Foo, 2);␊
      t.is(exports$1.default.default, 3);␊
      t.is(Foo, 1);␊
      t.is(_var, 'VAR');␊
      `,
    }

## dynamic-module-require

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var submodule;␊
      var hasRequiredSubmodule;␊
      ␊
      function requireSubmodule () {␊
      	if (hasRequiredSubmodule) return submodule;␊
      	hasRequiredSubmodule = 1;␊
      	submodule = function () {␊
      	  return 'Hello there';␊
      	};␊
      	return submodule;␊
      }␊
      ␊
      var dynamicModules;␊
      ␊
      function getDynamicModules() {␊
      	return dynamicModules || (dynamicModules = {␊
      		"/fixtures/function/dynamic-module-require/submodule.js": requireSubmodule␊
      	});␊
      }␊
      ␊
      function createCommonjsRequire(originalModuleDir) {␊
      	function handleRequire(path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return getDynamicModules()[resolvedPath]();␊
      		}␊
      		throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      	}␊
      	handleRequire.resolve = function (path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return resolvedPath;␊
      		}␊
      		return require.resolve(path);␊
      	};␊
      	return handleRequire;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	var shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	var relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '';␊
      	}␊
      	var modules = getDynamicModules();␊
      	var checkedExtensions = ['', '.js', '.json'];␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = normalize(originalModuleDir + '/' + path);␊
      		} else {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {␊
      			var resolvedPath = relPath + checkedExtensions[extensionIndex];␊
      			if (modules[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		var nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	var c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	var c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;␊
      	return true;␊
      }␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	var parts = path.split('/');␊
      	var slashed = parts[0] === '';␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/') path = '/' + path;␊
      	else if (path.length === 0) path = '.';␊
      	return path;␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      let message;␊
      ␊
      function takeModule(withName) {␊
        return createCommonjsRequire("/fixtures/function/dynamic-module-require")(`./${withName}`);␊
      }␊
      ␊
      try {␊
        const submodule = takeModule('submodule');␊
        message = submodule();␊
      } catch (err) {␊
        ({ message } = err);␊
      }␊
      ␊
      t.is(message, 'Hello there');␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var submodule;␊
      var hasRequiredSubmodule;␊
      ␊
      function requireSubmodule () {␊
      	if (hasRequiredSubmodule) return submodule;␊
      	hasRequiredSubmodule = 1;␊
      	submodule = function () {␊
      	  return 'Hello there';␊
      	};␊
      	return submodule;␊
      }␊
      ␊
      var dynamicModules;␊
      ␊
      function getDynamicModules() {␊
      	return dynamicModules || (dynamicModules = {␊
      		"/fixtures/function/dynamic-require/submodule.js": requireSubmodule␊
      	});␊
      }␊
      ␊
      function createCommonjsRequire(originalModuleDir) {␊
      	function handleRequire(path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return getDynamicModules()[resolvedPath]();␊
      		}␊
      		throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      	}␊
      	handleRequire.resolve = function (path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return resolvedPath;␊
      		}␊
      		return require.resolve(path);␊
      	};␊
      	return handleRequire;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	var shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	var relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '';␊
      	}␊
      	var modules = getDynamicModules();␊
      	var checkedExtensions = ['', '.js', '.json'];␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = normalize(originalModuleDir + '/' + path);␊
      		} else {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {␊
      			var resolvedPath = relPath + checkedExtensions[extensionIndex];␊
      			if (modules[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		var nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	var c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	var c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;␊
      	return true;␊
      }␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	var parts = path.split('/');␊
      	var slashed = parts[0] === '';␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/') path = '/' + path;␊
      	else if (path.length === 0) path = '.';␊
      	return path;␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      let message;␊
      ␊
      function takeModule(withName) {␊
        return createCommonjsRequire("/fixtures/function/dynamic-require")(`./${withName}`);␊
      }␊
      ␊
      try {␊
        const submodule = takeModule('submodule');␊
        message = submodule();␊
      } catch (err) {␊
        ({ message } = err);␊
      }␊
      ␊
      t.is(message, 'Hello there');␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-absolute-import

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var direct;␊
      var hasRequiredDirect;␊
      ␊
      function requireDirect () {␊
      	if (hasRequiredDirect) return direct;␊
      	hasRequiredDirect = 1;␊
      	direct = 'direct';␊
      	return direct;␊
      }␊
      ␊
      var nested;␊
      var hasRequiredNested;␊
      ␊
      function requireNested () {␊
      	if (hasRequiredNested) return nested;␊
      	hasRequiredNested = 1;␊
      	nested = 'nested';␊
      	return nested;␊
      }␊
      ␊
      var parent;␊
      var hasRequiredParent;␊
      ␊
      function requireParent () {␊
      	if (hasRequiredParent) return parent;␊
      	hasRequiredParent = 1;␊
      	parent = 'parent';␊
      	return parent;␊
      }␊
      ␊
      var dynamicModules;␊
      ␊
      function getDynamicModules() {␊
      	return dynamicModules || (dynamicModules = {␊
      		"/fixtures/function/dynamic-require-absolute-import/sub/node_modules/module/direct.js": requireDirect,␊
      		"/fixtures/function/dynamic-require-absolute-import/sub/node_modules/module/nested/nested.js": requireNested,␊
      		"/fixtures/function/dynamic-require-absolute-import/node_modules/parent-module/parent.js": requireParent␊
      	});␊
      }␊
      ␊
      function createCommonjsRequire(originalModuleDir) {␊
      	function handleRequire(path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return getDynamicModules()[resolvedPath]();␊
      		}␊
      		throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      	}␊
      	handleRequire.resolve = function (path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return resolvedPath;␊
      		}␊
      		return require.resolve(path);␊
      	};␊
      	return handleRequire;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	var shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	var relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '';␊
      	}␊
      	var modules = getDynamicModules();␊
      	var checkedExtensions = ['', '.js', '.json'];␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = normalize(originalModuleDir + '/' + path);␊
      		} else {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {␊
      			var resolvedPath = relPath + checkedExtensions[extensionIndex];␊
      			if (modules[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		var nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	var c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	var c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;␊
      	return true;␊
      }␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	var parts = path.split('/');␊
      	var slashed = parts[0] === '';␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/') path = '/' + path;␊
      	else if (path.length === 0) path = '.';␊
      	return path;␊
      }␊
      ␊
      var submodule = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(name) {␊
        return createCommonjsRequire("/fixtures/function/dynamic-require-absolute-import/sub")(name);␊
      }␊
      ␊
      submodule.moduleDirect = takeModule('module/direct');␊
      submodule.moduleNested = takeModule('module/nested/nested');␊
      submodule.parentModule = takeModule('parent-module/parent');␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      t.deepEqual(submodule, {␊
        moduleDirect: 'direct',␊
        moduleNested: 'nested',␊
        parentModule: 'parent'␊
      });␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-alias-hack

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$$0 = require('buffer');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);␊
      ␊
      var stub;␊
      var hasRequiredStub;␊
      ␊
      function requireStub () {␊
      	if (hasRequiredStub) return stub;␊
      	hasRequiredStub = 1;␊
      	stub = function () {␊
      	  return 'Hello there';␊
      	};␊
      	return stub;␊
      }␊
      ␊
      var dynamicModules;␊
      ␊
      function getDynamicModules() {␊
      	return dynamicModules || (dynamicModules = {␊
      		"/fixtures/function/dynamic-require-alias-hack/stub.js": requireStub␊
      	});␊
      }␊
      ␊
      function createCommonjsRequire(originalModuleDir) {␊
      	function handleRequire(path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return getDynamicModules()[resolvedPath]();␊
      		}␊
      		return require(path);␊
      	}␊
      	handleRequire.resolve = function (path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return resolvedPath;␊
      		}␊
      		return require.resolve(path);␊
      	};␊
      	return handleRequire;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	var shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	var relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '';␊
      	}␊
      	var modules = getDynamicModules();␊
      	var checkedExtensions = ['', '.js', '.json'];␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = normalize(originalModuleDir + '/' + path);␊
      		} else {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {␊
      			var resolvedPath = relPath + checkedExtensions[extensionIndex];␊
      			if (modules[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		var nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	var c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	var c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;␊
      	return true;␊
      }␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	var parts = path.split('/');␊
      	var slashed = parts[0] === '';␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/') path = '/' + path;␊
      	else if (path.length === 0) path = '.';␊
      	return path;␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable global-require */␊
      ␊
      // noinspection UnnecessaryLocalVariableJS␊
      ␊
      // A hack used in many old libraries, saying "workaround to exclude package from browserify list."␊
      // Will bypass rollup-commonjs finding out that this is a require that should not go through the plugin, and will do an infinite search.␊
      const _require = createCommonjsRequire("/fixtures/function/dynamic-require-alias-hack");␊
      const buffer = _require('buffer');␊
      ␊
      t.is(buffer, require$$0__default["default"]);␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-code-splitting

> Snapshot 1

    {
      'generated-lib2.js': `'use strict';␊
      ␊
      var target1;␊
      var hasRequiredTarget1;␊
      ␊
      function requireTarget1 () {␊
      	if (hasRequiredTarget1) return target1;␊
      	hasRequiredTarget1 = 1;␊
      	target1 = '1';␊
      	return target1;␊
      }␊
      ␊
      var target2;␊
      var hasRequiredTarget2;␊
      ␊
      function requireTarget2 () {␊
      	if (hasRequiredTarget2) return target2;␊
      	hasRequiredTarget2 = 1;␊
      	target2 = '2';␊
      	return target2;␊
      }␊
      ␊
      var dynamicModules;␊
      ␊
      function getDynamicModules() {␊
      	return dynamicModules || (dynamicModules = {␊
      		"/fixtures/function/dynamic-require-code-splitting/target1.js": requireTarget1,␊
      		"/fixtures/function/dynamic-require-code-splitting/target2.js": requireTarget2␊
      	});␊
      }␊
      ␊
      function createCommonjsRequire(originalModuleDir) {␊
      	function handleRequire(path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return getDynamicModules()[resolvedPath]();␊
      		}␊
      		throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      	}␊
      	handleRequire.resolve = function (path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return resolvedPath;␊
      		}␊
      		return require.resolve(path);␊
      	};␊
      	return handleRequire;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	var shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	var relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '';␊
      	}␊
      	var modules = getDynamicModules();␊
      	var checkedExtensions = ['', '.js', '.json'];␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = normalize(originalModuleDir + '/' + path);␊
      		} else {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {␊
      			var resolvedPath = relPath + checkedExtensions[extensionIndex];␊
      			if (modules[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		var nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	var c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	var c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;␊
      	return true;␊
      }␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	var parts = path.split('/');␊
      	var slashed = parts[0] === '';␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/') path = '/' + path;␊
      	else if (path.length === 0) path = '.';␊
      	return path;␊
      }␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      let message;␊
      ␊
      for (const index of [1, 2]) {␊
        try {␊
          message = createCommonjsRequire("/fixtures/function/dynamic-require-code-splitting")(`./target${index}.js`);␊
        } catch (err) {␊
          ({ message } = err);␊
        }␊
        t.is(message, index.toString());␊
      }␊
      ␊
      exports.createCommonjsRequire = createCommonjsRequire;␊
      `,
      'main.js': `'use strict';␊
      ␊
      var lib2 = require('./generated-lib2.js');␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      let message;␊
      ␊
      for (const index of [1, 2]) {␊
        try {␊
          message = lib2.createCommonjsRequire("/fixtures/function/dynamic-require-code-splitting")(`./target${index}.js`);␊
        } catch (err) {␊
          ({ message } = err);␊
        }␊
        t.is(message, index.toString());␊
      }␊
      `,
      'main2.js': `'use strict';␊
      ␊
      require('./generated-lib2.js');␊
      ␊
      `,
    }

## dynamic-require-different-loader

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var submodule2;␊
      var hasRequiredSubmodule2;␊
      ␊
      function requireSubmodule2 () {␊
      	if (hasRequiredSubmodule2) return submodule2;␊
      	hasRequiredSubmodule2 = 1;␊
      	submodule2 = function () {␊
      	  return 'Hello there';␊
      	};␊
      	return submodule2;␊
      }␊
      ␊
      const fn = requireSubmodule2();␊
      ␊
      var main = fn();␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-empty

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var submodule = {};␊
      ␊
      var hasRequiredSubmodule;␊
      ␊
      function requireSubmodule () {␊
      	if (hasRequiredSubmodule) return submodule;␊
      	hasRequiredSubmodule = 1;␊
      ␊
      	return submodule;␊
      }␊
      ␊
      var dynamicModules;␊
      ␊
      function getDynamicModules() {␊
      	return dynamicModules || (dynamicModules = {␊
      		"/fixtures/function/dynamic-require-empty/submodule.js": requireSubmodule␊
      	});␊
      }␊
      ␊
      function createCommonjsRequire(originalModuleDir) {␊
      	function handleRequire(path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return getDynamicModules()[resolvedPath]();␊
      		}␊
      		throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      	}␊
      	handleRequire.resolve = function (path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return resolvedPath;␊
      		}␊
      		return require.resolve(path);␊
      	};␊
      	return handleRequire;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	var shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	var relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '';␊
      	}␊
      	var modules = getDynamicModules();␊
      	var checkedExtensions = ['', '.js', '.json'];␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = normalize(originalModuleDir + '/' + path);␊
      		} else {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {␊
      			var resolvedPath = relPath + checkedExtensions[extensionIndex];␊
      			if (modules[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		var nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	var c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	var c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;␊
      	return true;␊
      }␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	var parts = path.split('/');␊
      	var slashed = parts[0] === '';␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/') path = '/' + path;␊
      	else if (path.length === 0) path = '.';␊
      	return path;␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(withName) {␊
        return createCommonjsRequire("/fixtures/function/dynamic-require-empty")(`./${withName}`);␊
      }␊
      ␊
      t.deepEqual(takeModule('submodule'), {});␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-es-entry

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var submodule;␊
      var hasRequiredSubmodule;␊
      ␊
      function requireSubmodule () {␊
      	if (hasRequiredSubmodule) return submodule;␊
      	hasRequiredSubmodule = 1;␊
      	submodule = 'submodule';␊
      	return submodule;␊
      }␊
      ␊
      var dynamicModules;␊
      ␊
      function getDynamicModules() {␊
      	return dynamicModules || (dynamicModules = {␊
      		"/fixtures/function/dynamic-require-es-entry/submodule.js": requireSubmodule␊
      	});␊
      }␊
      ␊
      function createCommonjsRequire(originalModuleDir) {␊
      	function handleRequire(path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return getDynamicModules()[resolvedPath]();␊
      		}␊
      		throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      	}␊
      	handleRequire.resolve = function (path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return resolvedPath;␊
      		}␊
      		return require.resolve(path);␊
      	};␊
      	return handleRequire;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	var shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	var relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '';␊
      	}␊
      	var modules = getDynamicModules();␊
      	var checkedExtensions = ['', '.js', '.json'];␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = normalize(originalModuleDir + '/' + path);␊
      		} else {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {␊
      			var resolvedPath = relPath + checkedExtensions[extensionIndex];␊
      			if (modules[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		var nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	var c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	var c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;␊
      	return true;␊
      }␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	var parts = path.split('/');␊
      	var slashed = parts[0] === '';␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/') path = '/' + path;␊
      	else if (path.length === 0) path = '.';␊
      	return path;␊
      }␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(withName) {␊
        return createCommonjsRequire("/fixtures/function/dynamic-require-es-entry")(`./${withName}`);␊
      }␊
      ␊
      var importer = takeModule('submodule.js');␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      t.is(importer, 'submodule');␊
      `,
    }

## dynamic-require-es-mixed-helpers

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      var submodule;␊
      var hasRequiredSubmodule;␊
      ␊
      function requireSubmodule () {␊
      	if (hasRequiredSubmodule) return submodule;␊
      	hasRequiredSubmodule = 1;␊
      	commonjsGlobal.hasSubmoduleRun = true;␊
      	submodule = 'submodule';␊
      	return submodule;␊
      }␊
      ␊
      t.is(global.hasSubmoduleRun, undefined, 'before require');␊
      ␊
      // eslint-disable-next-line global-require␊
      var result = requireSubmodule();␊
      ␊
      t.is(global.hasSubmoduleRun, true, 'after require');␊
      delete global.hasSubmoduleRun;␊
      ␊
      t.is(result, 'submodule');␊
      `,
    }

## dynamic-require-extensions

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var submodule;␊
      var hasRequiredSubmodule;␊
      ␊
      function requireSubmodule () {␊
      	if (hasRequiredSubmodule) return submodule;␊
      	hasRequiredSubmodule = 1;␊
      	submodule = { name: 'submodule', value: null };␊
      	return submodule;␊
      }␊
      ␊
      var dynamicModules;␊
      ␊
      function getDynamicModules() {␊
      	return dynamicModules || (dynamicModules = {␊
      		"/fixtures/function/dynamic-require-extensions/submodule.js": requireSubmodule␊
      	});␊
      }␊
      ␊
      function createCommonjsRequire(originalModuleDir) {␊
      	function handleRequire(path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return getDynamicModules()[resolvedPath]();␊
      		}␊
      		throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      	}␊
      	handleRequire.resolve = function (path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return resolvedPath;␊
      		}␊
      		return require.resolve(path);␊
      	};␊
      	return handleRequire;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	var shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	var relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '';␊
      	}␊
      	var modules = getDynamicModules();␊
      	var checkedExtensions = ['', '.js', '.json'];␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = normalize(originalModuleDir + '/' + path);␊
      		} else {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {␊
      			var resolvedPath = relPath + checkedExtensions[extensionIndex];␊
      			if (modules[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		var nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	var c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	var c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;␊
      	return true;␊
      }␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	var parts = path.split('/');␊
      	var slashed = parts[0] === '';␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/') path = '/' + path;␊
      	else if (path.length === 0) path = '.';␊
      	return path;␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(withName) {␊
        return createCommonjsRequire("/fixtures/function/dynamic-require-extensions")(`./${withName}`);␊
      }␊
      ␊
      const withExtension = takeModule('submodule.js');␊
      const withoutExtension = takeModule('submodule');␊
      ␊
      t.is(withExtension.name, 'submodule');␊
      t.is(withoutExtension.name, 'submodule');␊
      ␊
      withExtension.value = 'mutated';␊
      ␊
      t.is(withoutExtension.value, 'mutated');␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-fallback

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(withName) {␊
        return require(withName);␊
      }␊
      ␊
      // The bundled code will run from test/helpers/util.js␊
      t.is(takeModule('../fixtures/function/dynamic-require-fallback/dep.js'), 'dep');␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-from-es-import

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var submodule;␊
      var hasRequiredSubmodule;␊
      ␊
      function requireSubmodule () {␊
      	if (hasRequiredSubmodule) return submodule;␊
      	hasRequiredSubmodule = 1;␊
      	submodule = 'submodule';␊
      	return submodule;␊
      }␊
      ␊
      var submoduleExports = requireSubmodule();␊
      ␊
      t.is(submoduleExports, 'submodule');␊
      `,
    }

## dynamic-require-globs

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var submodule1;␊
      var hasRequiredSubmodule1;␊
      ␊
      function requireSubmodule1 () {␊
      	if (hasRequiredSubmodule1) return submodule1;␊
      	hasRequiredSubmodule1 = 1;␊
      	submodule1 = 'submodule1';␊
      	return submodule1;␊
      }␊
      ␊
      var submodule2;␊
      var hasRequiredSubmodule2;␊
      ␊
      function requireSubmodule2 () {␊
      	if (hasRequiredSubmodule2) return submodule2;␊
      	hasRequiredSubmodule2 = 1;␊
      	submodule2 = 'submodule2';␊
      	return submodule2;␊
      }␊
      ␊
      var extramodule1;␊
      var hasRequiredExtramodule1;␊
      ␊
      function requireExtramodule1 () {␊
      	if (hasRequiredExtramodule1) return extramodule1;␊
      	hasRequiredExtramodule1 = 1;␊
      	extramodule1 = 'extramodule1';␊
      	return extramodule1;␊
      }␊
      ␊
      var dynamicModules;␊
      ␊
      function getDynamicModules() {␊
      	return dynamicModules || (dynamicModules = {␊
      		"/fixtures/function/dynamic-require-globs/submodule1.js": requireSubmodule1,␊
      		"/fixtures/function/dynamic-require-globs/submodule2.js": requireSubmodule2,␊
      		"/fixtures/function/dynamic-require-globs/extramodule1.js": requireExtramodule1␊
      	});␊
      }␊
      ␊
      function createCommonjsRequire(originalModuleDir) {␊
      	function handleRequire(path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return getDynamicModules()[resolvedPath]();␊
      		}␊
      		throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      	}␊
      	handleRequire.resolve = function (path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return resolvedPath;␊
      		}␊
      		return require.resolve(path);␊
      	};␊
      	return handleRequire;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	var shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	var relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '';␊
      	}␊
      	var modules = getDynamicModules();␊
      	var checkedExtensions = ['', '.js', '.json'];␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = normalize(originalModuleDir + '/' + path);␊
      		} else {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {␊
      			var resolvedPath = relPath + checkedExtensions[extensionIndex];␊
      			if (modules[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		var nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	var c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	var c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;␊
      	return true;␊
      }␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	var parts = path.split('/');␊
      	var slashed = parts[0] === '';␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/') path = '/' + path;␊
      	else if (path.length === 0) path = '.';␊
      	return path;␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(withName) {␊
        return createCommonjsRequire("/fixtures/function/dynamic-require-globs")(`./${withName}`);␊
      }␊
      ␊
      t.is(takeModule('submodule1.js'), 'submodule1');␊
      t.is(takeModule('submodule2.js'), 'submodule2');␊
      t.is(takeModule('extramodule1.js'), 'extramodule1');␊
      t.throws(() => takeModule('extramodule2.js'), {␊
        message:␊
          'Could not dynamically require "./extramodule2.js". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'␊
      });␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-instances

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var direct;␊
      var hasRequiredDirect;␊
      ␊
      function requireDirect () {␊
      	if (hasRequiredDirect) return direct;␊
      	hasRequiredDirect = 1;␊
      	direct = { name: 'direct', value: null };␊
      	return direct;␊
      }␊
      ␊
      var main$1;␊
      var hasRequiredMain;␊
      ␊
      function requireMain () {␊
      	if (hasRequiredMain) return main$1;␊
      	hasRequiredMain = 1;␊
      	main$1 = { name: 'package', value: null };␊
      	return main$1;␊
      }␊
      ␊
      var dynamicModules;␊
      ␊
      function getDynamicModules() {␊
      	return dynamicModules || (dynamicModules = {␊
      		"/fixtures/function/dynamic-require-instances/direct": requireDirect,␊
      		"/fixtures/function/dynamic-require-instances/direct/index.js": requireDirect,␊
      		"/fixtures/function/dynamic-require-instances/package": requireMain,␊
      		"/fixtures/function/dynamic-require-instances/package/main.js": requireMain␊
      	});␊
      }␊
      ␊
      function createCommonjsRequire(originalModuleDir) {␊
      	function handleRequire(path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return getDynamicModules()[resolvedPath]();␊
      		}␊
      		throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      	}␊
      	handleRequire.resolve = function (path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return resolvedPath;␊
      		}␊
      		return require.resolve(path);␊
      	};␊
      	return handleRequire;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	var shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	var relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '';␊
      	}␊
      	var modules = getDynamicModules();␊
      	var checkedExtensions = ['', '.js', '.json'];␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = normalize(originalModuleDir + '/' + path);␊
      		} else {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {␊
      			var resolvedPath = relPath + checkedExtensions[extensionIndex];␊
      			if (modules[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		var nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	var c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	var c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;␊
      	return true;␊
      }␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	var parts = path.split('/');␊
      	var slashed = parts[0] === '';␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/') path = '/' + path;␊
      	else if (path.length === 0) path = '.';␊
      	return path;␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(withName) {␊
        return createCommonjsRequire("/fixtures/function/dynamic-require-instances")(withName);␊
      }␊
      ␊
      takeModule('./direct').value = 'direct-instance';␊
      t.is(takeModule('./direct/index.js').value, 'direct-instance');␊
      t.is(requireDirect().value, 'direct-instance');␊
      ␊
      takeModule('./package').value = 'package-instance';␊
      t.is(takeModule('./package/main.js').value, 'package-instance');␊
      t.is(requireMain().value, 'package-instance');␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-json

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var value = "present";␊
      var json0 = {␊
      	value: value␊
      };␊
      ␊
      var dynamicModules;␊
      ␊
      function getDynamicModules() {␊
      	return dynamicModules || (dynamicModules = {␊
      		"/fixtures/function/dynamic-require-json/dynamic.json": function () { return json0; }␊
      	});␊
      }␊
      ␊
      function createCommonjsRequire(originalModuleDir) {␊
      	function handleRequire(path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return getDynamicModules()[resolvedPath]();␊
      		}␊
      		throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      	}␊
      	handleRequire.resolve = function (path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return resolvedPath;␊
      		}␊
      		return require.resolve(path);␊
      	};␊
      	return handleRequire;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	var shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	var relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '';␊
      	}␊
      	var modules = getDynamicModules();␊
      	var checkedExtensions = ['', '.js', '.json'];␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = normalize(originalModuleDir + '/' + path);␊
      		} else {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {␊
      			var resolvedPath = relPath + checkedExtensions[extensionIndex];␊
      			if (modules[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		var nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	var c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	var c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;␊
      	return true;␊
      }␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	var parts = path.split('/');␊
      	var slashed = parts[0] === '';␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/') path = '/' + path;␊
      	else if (path.length === 0) path = '.';␊
      	return path;␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(withName) {␊
        return createCommonjsRequire("/fixtures/function/dynamic-require-json")(`./${withName}`);␊
      }␊
      ␊
      t.deepEqual(takeModule('dynamic.json'), { value: 'present' });␊
      t.deepEqual(takeModule('dynamic'), { value: 'present' });␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-no-fallback

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function commonjsRequire(path) {␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(withName) {␊
        return commonjsRequire(withName);␊
      }␊
      ␊
      t.throws(() => takeModule('./dep.js'), {␊
        message:␊
          'Could not dynamically require "./dep.js". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'␊
      });␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-package

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var entry$2;␊
      var hasRequiredEntry$2;␊
      ␊
      function requireEntry$2 () {␊
      	if (hasRequiredEntry$2) return entry$2;␊
      	hasRequiredEntry$2 = 1;␊
      	entry$2 = 'same-directory';␊
      	return entry$2;␊
      }␊
      ␊
      var entry$1;␊
      var hasRequiredEntry$1;␊
      ␊
      function requireEntry$1 () {␊
      	if (hasRequiredEntry$1) return entry$1;␊
      	hasRequiredEntry$1 = 1;␊
      	entry$1 = 'sub';␊
      	return entry$1;␊
      }␊
      ␊
      var entry;␊
      var hasRequiredEntry;␊
      ␊
      function requireEntry () {␊
      	if (hasRequiredEntry) return entry;␊
      	hasRequiredEntry = 1;␊
      	entry = 'custom-module';␊
      	return entry;␊
      }␊
      ␊
      var dynamicModules;␊
      ␊
      function getDynamicModules() {␊
      	return dynamicModules || (dynamicModules = {␊
      		"/fixtures/function/dynamic-require-package": requireEntry$2,␊
      		"/fixtures/function/dynamic-require-package/entry.js": requireEntry$2,␊
      		"/fixtures/function/dynamic-require-package/sub": requireEntry$1,␊
      		"/fixtures/function/dynamic-require-package/sub/entry.js": requireEntry$1,␊
      		"/fixtures/function/dynamic-require-package/node_modules/custom-module": requireEntry,␊
      		"/fixtures/function/dynamic-require-package/node_modules/custom-module/entry.js": requireEntry␊
      	});␊
      }␊
      ␊
      function createCommonjsRequire(originalModuleDir) {␊
      	function handleRequire(path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return getDynamicModules()[resolvedPath]();␊
      		}␊
      		throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      	}␊
      	handleRequire.resolve = function (path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return resolvedPath;␊
      		}␊
      		return require.resolve(path);␊
      	};␊
      	return handleRequire;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	var shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	var relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '';␊
      	}␊
      	var modules = getDynamicModules();␊
      	var checkedExtensions = ['', '.js', '.json'];␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = normalize(originalModuleDir + '/' + path);␊
      		} else {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {␊
      			var resolvedPath = relPath + checkedExtensions[extensionIndex];␊
      			if (modules[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		var nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	var c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	var c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;␊
      	return true;␊
      }␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	var parts = path.split('/');␊
      	var slashed = parts[0] === '';␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/') path = '/' + path;␊
      	else if (path.length === 0) path = '.';␊
      	return path;␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule$1(name) {␊
        return createCommonjsRequire("/fixtures/function/dynamic-require-package/sub")(name);␊
      }␊
      ␊
      var sub = {␊
        parent: takeModule$1('..'),␊
        customModule: takeModule$1('custom-module')␊
      };␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(name) {␊
        return createCommonjsRequire("/fixtures/function/dynamic-require-package")(name);␊
      }␊
      ␊
      t.is(takeModule('.'), 'same-directory');␊
      t.is(takeModule('./'), 'same-directory');␊
      t.is(takeModule('.//'), 'same-directory');␊
      ␊
      t.is(takeModule('./sub'), 'sub');␊
      ␊
      t.is(takeModule('custom-module'), 'custom-module');␊
      t.deepEqual(sub, { parent: 'same-directory', customModule: 'custom-module' });␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-package-sub

> Snapshot 1

    {
      'entry.js': `'use strict';␊
      ␊
      var entry$1 = {};␊
      ␊
      var entry;␊
      var hasRequiredEntry;␊
      ␊
      function requireEntry () {␊
      	if (hasRequiredEntry) return entry;␊
      	hasRequiredEntry = 1;␊
      	entry = 'custom-module';␊
      	return entry;␊
      }␊
      ␊
      t.is(requireEntry(), 'custom-module');␊
      ␊
      module.exports = entry$1;␊
      `,
    }

## dynamic-require-relative-paths

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var submodule;␊
      var hasRequiredSubmodule;␊
      ␊
      function requireSubmodule () {␊
      	if (hasRequiredSubmodule) return submodule;␊
      	hasRequiredSubmodule = 1;␊
      	submodule = 'submodule';␊
      	return submodule;␊
      }␊
      ␊
      var subsubmodule;␊
      var hasRequiredSubsubmodule;␊
      ␊
      function requireSubsubmodule () {␊
      	if (hasRequiredSubsubmodule) return subsubmodule;␊
      	hasRequiredSubsubmodule = 1;␊
      	subsubmodule = 'subsubmodule';␊
      	return subsubmodule;␊
      }␊
      ␊
      var dynamicModules;␊
      ␊
      function getDynamicModules() {␊
      	return dynamicModules || (dynamicModules = {␊
      		"/fixtures/function/dynamic-require-relative-paths/sub/submodule.js": requireSubmodule,␊
      		"/fixtures/function/dynamic-require-relative-paths/sub/subsub/subsubmodule.js": requireSubsubmodule␊
      	});␊
      }␊
      ␊
      function createCommonjsRequire(originalModuleDir) {␊
      	function handleRequire(path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return getDynamicModules()[resolvedPath]();␊
      		}␊
      		throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      	}␊
      	handleRequire.resolve = function (path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return resolvedPath;␊
      		}␊
      		return require.resolve(path);␊
      	};␊
      	return handleRequire;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	var shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	var relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '';␊
      	}␊
      	var modules = getDynamicModules();␊
      	var checkedExtensions = ['', '.js', '.json'];␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = normalize(originalModuleDir + '/' + path);␊
      		} else {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {␊
      			var resolvedPath = relPath + checkedExtensions[extensionIndex];␊
      			if (modules[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		var nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	var c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	var c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;␊
      	return true;␊
      }␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	var parts = path.split('/');␊
      	var slashed = parts[0] === '';␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/') path = '/' + path;␊
      	else if (path.length === 0) path = '.';␊
      	return path;␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModuleWithDelimiter(name, delimiter) {␊
        return createCommonjsRequire("/fixtures/function/dynamic-require-relative-paths")(`.${delimiter}${name.replace(/=/g, delimiter)}`);␊
      }␊
      ␊
      t.is(takeModuleWithDelimiter('sub=submodule.js', '/'), 'submodule');␊
      t.is(takeModuleWithDelimiter('sub=subsub=subsubmodule.js', '/'), 'subsubmodule');␊
      t.is(takeModuleWithDelimiter('sub=submodule.js', '\\\\'), 'submodule');␊
      t.is(takeModuleWithDelimiter('sub=subsub=subsubmodule.js', '\\\\'), 'subsubmodule');␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-resolve-index

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var dynamicRequireResolveIndex;␊
      var hasRequiredDynamicRequireResolveIndex;␊
      ␊
      function requireDynamicRequireResolveIndex () {␊
      	if (hasRequiredDynamicRequireResolveIndex) return dynamicRequireResolveIndex;␊
      	hasRequiredDynamicRequireResolveIndex = 1;␊
      	dynamicRequireResolveIndex = 'same-directory';␊
      	return dynamicRequireResolveIndex;␊
      }␊
      ␊
      var sub$1;␊
      var hasRequiredSub;␊
      ␊
      function requireSub () {␊
      	if (hasRequiredSub) return sub$1;␊
      	hasRequiredSub = 1;␊
      	sub$1 = 'sub';␊
      	return sub$1;␊
      }␊
      ␊
      var customModule;␊
      var hasRequiredCustomModule;␊
      ␊
      function requireCustomModule () {␊
      	if (hasRequiredCustomModule) return customModule;␊
      	hasRequiredCustomModule = 1;␊
      	customModule = 'custom-module';␊
      	return customModule;␊
      }␊
      ␊
      var dynamicModules;␊
      ␊
      function getDynamicModules() {␊
      	return dynamicModules || (dynamicModules = {␊
      		"/fixtures/function/dynamic-require-resolve-index": requireDynamicRequireResolveIndex,␊
      		"/fixtures/function/dynamic-require-resolve-index/index.js": requireDynamicRequireResolveIndex,␊
      		"/fixtures/function/dynamic-require-resolve-index/sub": requireSub,␊
      		"/fixtures/function/dynamic-require-resolve-index/sub/index.js": requireSub,␊
      		"/fixtures/function/dynamic-require-resolve-index/node_modules/custom-module": requireCustomModule,␊
      		"/fixtures/function/dynamic-require-resolve-index/node_modules/custom-module/index.js": requireCustomModule␊
      	});␊
      }␊
      ␊
      function createCommonjsRequire(originalModuleDir) {␊
      	function handleRequire(path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return getDynamicModules()[resolvedPath]();␊
      		}␊
      		throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      	}␊
      	handleRequire.resolve = function (path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return resolvedPath;␊
      		}␊
      		return require.resolve(path);␊
      	};␊
      	return handleRequire;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	var shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	var relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '';␊
      	}␊
      	var modules = getDynamicModules();␊
      	var checkedExtensions = ['', '.js', '.json'];␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = normalize(originalModuleDir + '/' + path);␊
      		} else {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {␊
      			var resolvedPath = relPath + checkedExtensions[extensionIndex];␊
      			if (modules[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		var nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	var c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	var c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;␊
      	return true;␊
      }␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	var parts = path.split('/');␊
      	var slashed = parts[0] === '';␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/') path = '/' + path;␊
      	else if (path.length === 0) path = '.';␊
      	return path;␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule$1(name) {␊
        return createCommonjsRequire("/fixtures/function/dynamic-require-resolve-index/sub")(name);␊
      }␊
      ␊
      var sub = {␊
        parent: takeModule$1('..'),␊
        customModule: takeModule$1('custom-module')␊
      };␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(name) {␊
        return createCommonjsRequire("/fixtures/function/dynamic-require-resolve-index")(name);␊
      }␊
      ␊
      t.is(takeModule('.'), 'same-directory');␊
      t.is(takeModule('./'), 'same-directory');␊
      t.is(takeModule('.//'), 'same-directory');␊
      ␊
      t.is(takeModule('./sub'), 'sub');␊
      ␊
      t.is(takeModule('custom-module'), 'custom-module');␊
      t.deepEqual(sub, { parent: 'same-directory', customModule: 'custom-module' });␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-resolve-reference

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var customModule2;␊
      var hasRequiredCustomModule2;␊
      ␊
      function requireCustomModule2 () {␊
      	if (hasRequiredCustomModule2) return customModule2;␊
      	hasRequiredCustomModule2 = 1;␊
      	customModule2 = () => createCommonjsRequire("/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module2").resolve('custom-module');␊
      	return customModule2;␊
      }␊
      ␊
      var dynamicModules;␊
      ␊
      function getDynamicModules() {␊
      	return dynamicModules || (dynamicModules = {␊
      		"/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module": requireCustomModule,␊
      		"/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module/index.js": requireCustomModule,␊
      		"/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module2": requireCustomModule2,␊
      		"/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module2/index.js": requireCustomModule2␊
      	});␊
      }␊
      ␊
      function createCommonjsRequire(originalModuleDir) {␊
      	function handleRequire(path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return getDynamicModules()[resolvedPath]();␊
      		}␊
      		throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      	}␊
      	handleRequire.resolve = function (path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return resolvedPath;␊
      		}␊
      		return require.resolve(path);␊
      	};␊
      	return handleRequire;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	var shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	var relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '';␊
      	}␊
      	var modules = getDynamicModules();␊
      	var checkedExtensions = ['', '.js', '.json'];␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = normalize(originalModuleDir + '/' + path);␊
      		} else {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {␊
      			var resolvedPath = relPath + checkedExtensions[extensionIndex];␊
      			if (modules[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		var nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	var c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	var c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;␊
      	return true;␊
      }␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	var parts = path.split('/');␊
      	var slashed = parts[0] === '';␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/') path = '/' + path;␊
      	else if (path.length === 0) path = '.';␊
      	return path;␊
      }␊
      ␊
      var customModule = {exports: {}};␊
      ␊
      var hasRequiredCustomModule;␊
      ␊
      function requireCustomModule () {␊
      	if (hasRequiredCustomModule) return customModule.exports;␊
      	hasRequiredCustomModule = 1;␊
      	(function (module) {␊
      		module.exports = () => createCommonjsRequire("/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module").resolve('custom-module2');␊
      } (customModule));␊
      	return customModule.exports;␊
      }␊
      ␊
      t.is(␊
        requireCustomModule()(),␊
        '/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module2'␊
      );␊
      t.is(␊
        requireCustomModule2()(),␊
        '/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module'␊
      );␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-root

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var submodule;␊
      var hasRequiredSubmodule;␊
      ␊
      function requireSubmodule () {␊
      	if (hasRequiredSubmodule) return submodule;␊
      	hasRequiredSubmodule = 1;␊
      	submodule = function () {␊
      	  return 'Hello there';␊
      	};␊
      	return submodule;␊
      }␊
      ␊
      var dynamicModules;␊
      ␊
      function getDynamicModules() {␊
      	return dynamicModules || (dynamicModules = {␊
      		"/submodule.js": requireSubmodule␊
      	});␊
      }␊
      ␊
      function createCommonjsRequire(originalModuleDir) {␊
      	function handleRequire(path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return getDynamicModules()[resolvedPath]();␊
      		}␊
      		throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      	}␊
      	handleRequire.resolve = function (path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return resolvedPath;␊
      		}␊
      		return require.resolve(path);␊
      	};␊
      	return handleRequire;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	var shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	var relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '';␊
      	}␊
      	var modules = getDynamicModules();␊
      	var checkedExtensions = ['', '.js', '.json'];␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = normalize(originalModuleDir + '/' + path);␊
      		} else {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {␊
      			var resolvedPath = relPath + checkedExtensions[extensionIndex];␊
      			if (modules[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		var nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	var c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	var c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;␊
      	return true;␊
      }␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	var parts = path.split('/');␊
      	var slashed = parts[0] === '';␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/') path = '/' + path;␊
      	else if (path.length === 0) path = '.';␊
      	return path;␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      let message;␊
      ␊
      function takeModule(withName) {␊
        return createCommonjsRequire("/")(`./${withName}`);␊
      }␊
      ␊
      try {␊
        const submodule = takeModule('submodule');␊
        message = submodule();␊
      } catch (err) {␊
        ({ message } = err);␊
      }␊
      ␊
      t.is(message, 'Hello there');␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-root-circular

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var customModule = {exports: {}};␊
      ␊
      var circular = {};␊
      ␊
      var hasRequiredCircular;␊
      ␊
      function requireCircular () {␊
      	if (hasRequiredCircular) return circular;␊
      	hasRequiredCircular = 1;␊
      	const lib = requireCustomModule();␊
      ␊
      	circular.extend1 = function (exports) {␊
      	  exports.get2 = function () {␊
      	    return 'indirect ref';␊
      	  };␊
      	};␊
      ␊
      	circular.extend2 = function (exports) {␊
      	  exports.get3 = lib.get1;␊
      	};␊
      	return circular;␊
      }␊
      ␊
      var hasRequiredCustomModule;␊
      ␊
      function requireCustomModule () {␊
      	if (hasRequiredCustomModule) return customModule.exports;␊
      	hasRequiredCustomModule = 1;␊
      	(function (module) {␊
      		const circular = requireCircular();␊
      ␊
      		circular.extend1(module.exports);␊
      ␊
      		module.exports.get1 = function () {␊
      		  return 'all good';␊
      		};␊
      ␊
      		circular.extend2(module.exports);␊
      } (customModule));␊
      	return customModule.exports;␊
      }␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      const custom = requireCustomModule();␊
      ␊
      t.is(custom.get1(), 'all good');␊
      t.is(custom.get2(), 'indirect ref');␊
      t.is(custom.get3(), custom.get1());␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-slash-access

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var dynamicRequireSlashAccess;␊
      var hasRequiredDynamicRequireSlashAccess;␊
      ␊
      function requireDynamicRequireSlashAccess () {␊
      	if (hasRequiredDynamicRequireSlashAccess) return dynamicRequireSlashAccess;␊
      	hasRequiredDynamicRequireSlashAccess = 1;␊
      	dynamicRequireSlashAccess = 'same-directory';␊
      	return dynamicRequireSlashAccess;␊
      }␊
      ␊
      var sub$2;␊
      var hasRequiredSub$1;␊
      ␊
      function requireSub$1 () {␊
      	if (hasRequiredSub$1) return sub$2;␊
      	hasRequiredSub$1 = 1;␊
      	sub$2 = 'sub';␊
      	return sub$2;␊
      }␊
      ␊
      var sub$1;␊
      var hasRequiredSub;␊
      ␊
      function requireSub () {␊
      	if (hasRequiredSub) return sub$1;␊
      	hasRequiredSub = 1;␊
      	sub$1 = 'sub';␊
      	return sub$1;␊
      }␊
      ␊
      var customModule;␊
      var hasRequiredCustomModule;␊
      ␊
      function requireCustomModule () {␊
      	if (hasRequiredCustomModule) return customModule;␊
      	hasRequiredCustomModule = 1;␊
      	customModule = 'custom-module' + ' + ' + requireSub();␊
      	return customModule;␊
      }␊
      ␊
      var dynamicModules;␊
      ␊
      function getDynamicModules() {␊
      	return dynamicModules || (dynamicModules = {␊
      		"/fixtures/function/dynamic-require-slash-access": requireDynamicRequireSlashAccess,␊
      		"/fixtures/function/dynamic-require-slash-access/index.js": requireDynamicRequireSlashAccess,␊
      		"/fixtures/function/dynamic-require-slash-access/sub": requireSub$1,␊
      		"/fixtures/function/dynamic-require-slash-access/sub/index.js": requireSub$1,␊
      		"/fixtures/function/dynamic-require-slash-access/node_modules/custom-module": requireCustomModule,␊
      		"/fixtures/function/dynamic-require-slash-access/node_modules/custom-module/index.js": requireCustomModule,␊
      		"/fixtures/function/dynamic-require-slash-access/node_modules/custom-module2/sub.js": requireSub␊
      	});␊
      }␊
      ␊
      function createCommonjsRequire(originalModuleDir) {␊
      	function handleRequire(path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return getDynamicModules()[resolvedPath]();␊
      		}␊
      		throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      	}␊
      	handleRequire.resolve = function (path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return resolvedPath;␊
      		}␊
      		return require.resolve(path);␊
      	};␊
      	return handleRequire;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	var shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	var relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '';␊
      	}␊
      	var modules = getDynamicModules();␊
      	var checkedExtensions = ['', '.js', '.json'];␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = normalize(originalModuleDir + '/' + path);␊
      		} else {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {␊
      			var resolvedPath = relPath + checkedExtensions[extensionIndex];␊
      			if (modules[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		var nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	var c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	var c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;␊
      	return true;␊
      }␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	var parts = path.split('/');␊
      	var slashed = parts[0] === '';␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/') path = '/' + path;␊
      	else if (path.length === 0) path = '.';␊
      	return path;␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule$1(name) {␊
        return createCommonjsRequire("/fixtures/function/dynamic-require-slash-access/sub")(name);␊
      }␊
      ␊
      var sub = {␊
        parent: takeModule$1('..'),␊
        customModule: takeModule$1('custom-module')␊
      };␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(name) {␊
        return createCommonjsRequire("/fixtures/function/dynamic-require-slash-access")(name);␊
      }␊
      ␊
      t.is(takeModule('.'), 'same-directory', '.');␊
      t.is(takeModule('./'), 'same-directory', './');␊
      t.is(takeModule('.//'), 'same-directory', './/');␊
      ␊
      t.is(takeModule('./sub'), 'sub', './sub');␊
      ␊
      t.is(takeModule('custom-module'), 'custom-module + sub', 'custom-module');␊
      t.deepEqual(sub, {␊
        parent: 'same-directory',␊
        customModule: 'custom-module + sub'␊
      });␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-targets-fallback

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var dep1;␊
      var hasRequiredDep1;␊
      ␊
      function requireDep1 () {␊
      	if (hasRequiredDep1) return dep1;␊
      	hasRequiredDep1 = 1;␊
      	dep1 = 'dep';␊
      	return dep1;␊
      }␊
      ␊
      var dynamicModules;␊
      ␊
      function getDynamicModules() {␊
      	return dynamicModules || (dynamicModules = {␊
      		"/fixtures/function/dynamic-require-targets-fallback/dep1.js": requireDep1␊
      	});␊
      }␊
      ␊
      function createCommonjsRequire(originalModuleDir) {␊
      	function handleRequire(path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return getDynamicModules()[resolvedPath]();␊
      		}␊
      		return require(path);␊
      	}␊
      	handleRequire.resolve = function (path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return resolvedPath;␊
      		}␊
      		return require.resolve(path);␊
      	};␊
      	return handleRequire;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	var shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	var relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '';␊
      	}␊
      	var modules = getDynamicModules();␊
      	var checkedExtensions = ['', '.js', '.json'];␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = normalize(originalModuleDir + '/' + path);␊
      		} else {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {␊
      			var resolvedPath = relPath + checkedExtensions[extensionIndex];␊
      			if (modules[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		var nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	var c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	var c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;␊
      	return true;␊
      }␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	var parts = path.split('/');␊
      	var slashed = parts[0] === '';␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/') path = '/' + path;␊
      	else if (path.length === 0) path = '.';␊
      	return path;␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(withName) {␊
        return createCommonjsRequire("/fixtures/function/dynamic-require-targets-fallback")(withName);␊
      }␊
      ␊
      t.is(takeModule('./dep1.js'), 'dep');␊
      // The bundled code will run from test/helpers/util.js␊
      t.is(takeModule('../fixtures/function/dynamic-require-targets-fallback/dep2.js'), 'dep');␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-targets-no-fallback

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var dep1;␊
      var hasRequiredDep1;␊
      ␊
      function requireDep1 () {␊
      	if (hasRequiredDep1) return dep1;␊
      	hasRequiredDep1 = 1;␊
      	dep1 = 'dep';␊
      	return dep1;␊
      }␊
      ␊
      var dynamicModules;␊
      ␊
      function getDynamicModules() {␊
      	return dynamicModules || (dynamicModules = {␊
      		"/fixtures/function/dynamic-require-targets-no-fallback/dep1.js": requireDep1␊
      	});␊
      }␊
      ␊
      function createCommonjsRequire(originalModuleDir) {␊
      	function handleRequire(path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return getDynamicModules()[resolvedPath]();␊
      		}␊
      		throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      	}␊
      	handleRequire.resolve = function (path) {␊
      		var resolvedPath = commonjsResolve(path, originalModuleDir);␊
      		if (resolvedPath !== null) {␊
      			return resolvedPath;␊
      		}␊
      		return require.resolve(path);␊
      	};␊
      	return handleRequire;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	var shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	var relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '';␊
      	}␊
      	var modules = getDynamicModules();␊
      	var checkedExtensions = ['', '.js', '.json'];␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = normalize(originalModuleDir + '/' + path);␊
      		} else {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {␊
      			var resolvedPath = relPath + checkedExtensions[extensionIndex];␊
      			if (modules[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		var nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	var c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	var c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;␊
      	return true;␊
      }␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	var parts = path.split('/');␊
      	var slashed = parts[0] === '';␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (var i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/') path = '/' + path;␊
      	else if (path.length === 0) path = '.';␊
      	return path;␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(withName) {␊
        return createCommonjsRequire("/fixtures/function/dynamic-require-targets-no-fallback")(withName);␊
      }␊
      ␊
      t.is(takeModule('./dep1.js'), 'dep');␊
      t.throws(() => takeModule('./dep2.js'), {␊
        message:␊
          'Could not dynamically require "./dep2.js". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'␊
      });␊
      ␊
      module.exports = main;␊
      `,
    }

## es6-export-with-global-sniffing

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      let root;␊
      ␊
      if (typeof self !== 'undefined') {␊
        root = self;␊
      } else if (typeof window !== 'undefined') {␊
        root = window;␊
      } else if (typeof global !== 'undefined') {␊
        root = global;␊
      } else if (typeof module !== 'undefined') {␊
        root = module;␊
      } else {␊
        root = Function('return this')(); // eslint-disable-line no-new-func␊
      }␊
      ␊
      root.pollution = 'foo';␊
      ␊
      const getGlobalPollution = () => 'foo';␊
      ␊
      // this test makes sure that "submodule" is not wrapped in commonjs␊
      ␊
      t.is(getGlobalPollution(), global.pollution);␊
      `,
    }

## esm-externals-false

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$$0 = require('external-cjs-exports');␊
      var require$$1 = require('external-cjs-module-exports');␊
      var require$$2 = require('external-esm-named');␊
      var require$$3 = require('external-esm-mixed');␊
      var require$$4 = require('external-esm-default');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);␊
      var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);␊
      var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);␊
      var require$$3__default = /*#__PURE__*/_interopDefaultLegacy(require$$3);␊
      var require$$4__default = /*#__PURE__*/_interopDefaultLegacy(require$$4);␊
      ␊
      var main = {};␊
      ␊
      const externalExports = require$$0__default["default"];␊
      const externalModuleExports = require$$1__default["default"];␊
      const externalNamed = require$$2__default["default"];␊
      const externalMixed = require$$3__default["default"];␊
      const externalDefault = require$$4__default["default"];␊
      ␊
      t.deepEqual(externalExports, { foo: 'foo' }, 'external exports');␊
      t.deepEqual(externalModuleExports, 'bar', 'external module exports');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, 'bar', 'external mixed');␊
      t.deepEqual(externalDefault, 'bar', 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## esm-externals-function

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$$0 = require('external-cjs-exports');␊
      var require$$1 = require('external-cjs-module-exports');␊
      var require$$2 = require('external-esm-named');␊
      var require$$3 = require('external-esm-mixed');␊
      var externalEsmDefault = require('external-esm-default');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      function _interopNamespace(e) {␊
      	if (e && e.__esModule) return e;␊
      	var n = Object.create(null);␊
      	if (e) {␊
      		Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default') {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () { return e[k]; }␊
      				});␊
      			}␊
      		});␊
      	}␊
      	n["default"] = e;␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);␊
      var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);␊
      var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);␊
      var require$$3__default = /*#__PURE__*/_interopDefaultLegacy(require$$3);␊
      var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespace(externalEsmDefault);␊
      ␊
      function getAugmentedNamespace(n) {␊
        var f = n.default;␊
      	if (typeof f == "function") {␊
      		var a = function () {␊
      			return f.apply(this, arguments);␊
      		};␊
      		a.prototype = f.prototype;␊
        } else a = {};␊
        Object.defineProperty(a, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      var require$$4 = /*@__PURE__*/getAugmentedNamespace(externalEsmDefault__namespace);␊
      ␊
      const externalExports = require$$0__default["default"];␊
      const externalModuleExports = require$$1__default["default"];␊
      const externalNamed = require$$2__default["default"];␊
      const externalMixed = require$$3__default["default"];␊
      const externalDefault = require$$4;␊
      ␊
      t.deepEqual(externalExports, { foo: 'foo' }, 'external exports');␊
      t.deepEqual(externalModuleExports, 'bar', 'external module exports');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, 'bar', 'external mixed');␊
      t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## esm-externals-list

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$$0 = require('external-cjs-exports');␊
      var require$$1 = require('external-cjs-module-exports');␊
      var require$$2 = require('external-esm-named');␊
      var require$$3 = require('external-esm-mixed');␊
      var externalEsmDefault = require('external-esm-default');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      function _interopNamespace(e) {␊
      	if (e && e.__esModule) return e;␊
      	var n = Object.create(null);␊
      	if (e) {␊
      		Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default') {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () { return e[k]; }␊
      				});␊
      			}␊
      		});␊
      	}␊
      	n["default"] = e;␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);␊
      var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);␊
      var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);␊
      var require$$3__default = /*#__PURE__*/_interopDefaultLegacy(require$$3);␊
      var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespace(externalEsmDefault);␊
      ␊
      function getAugmentedNamespace(n) {␊
        var f = n.default;␊
      	if (typeof f == "function") {␊
      		var a = function () {␊
      			return f.apply(this, arguments);␊
      		};␊
      		a.prototype = f.prototype;␊
        } else a = {};␊
        Object.defineProperty(a, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      var require$$4 = /*@__PURE__*/getAugmentedNamespace(externalEsmDefault__namespace);␊
      ␊
      const externalExports = require$$0__default["default"];␊
      const externalModuleExports = require$$1__default["default"];␊
      const externalNamed = require$$2__default["default"];␊
      const externalMixed = require$$3__default["default"];␊
      const externalDefault = require$$4;␊
      ␊
      t.deepEqual(externalExports, { foo: 'foo' }, 'external exports');␊
      t.deepEqual(externalModuleExports, 'bar', 'external module exports');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, 'bar', 'external mixed');␊
      t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## esm-externals-true

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var externalEsmNamed = require('external-esm-named');␊
      var externalEsmMixed = require('external-esm-mixed');␊
      var externalEsmDefault = require('external-esm-default');␊
      ␊
      function _interopNamespace(e) {␊
      	if (e && e.__esModule) return e;␊
      	var n = Object.create(null);␊
      	if (e) {␊
      		Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default') {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () { return e[k]; }␊
      				});␊
      			}␊
      		});␊
      	}␊
      	n["default"] = e;␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var externalEsmNamed__namespace = /*#__PURE__*/_interopNamespace(externalEsmNamed);␊
      var externalEsmMixed__namespace = /*#__PURE__*/_interopNamespace(externalEsmMixed);␊
      var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespace(externalEsmDefault);␊
      ␊
      function getAugmentedNamespace(n) {␊
        var f = n.default;␊
      	if (typeof f == "function") {␊
      		var a = function () {␊
      			return f.apply(this, arguments);␊
      		};␊
      		a.prototype = f.prototype;␊
        } else a = {};␊
        Object.defineProperty(a, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      var require$$0 = /*@__PURE__*/getAugmentedNamespace(externalEsmNamed__namespace);␊
      ␊
      var require$$1 = /*@__PURE__*/getAugmentedNamespace(externalEsmMixed__namespace);␊
      ␊
      var require$$2 = /*@__PURE__*/getAugmentedNamespace(externalEsmDefault__namespace);␊
      ␊
      const externalNamed = require$$0;␊
      const externalMixed = require$$1;␊
      const externalDefault = require$$2;␊
      ␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, { default: 'bar', foo: 'foo' }, 'external mixed');␊
      t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## esm-externals-undefined

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$$0 = require('external-cjs-exports');␊
      var require$$1 = require('external-cjs-module-exports');␊
      var require$$2 = require('external-esm-named');␊
      var require$$3 = require('external-esm-mixed');␊
      var require$$4 = require('external-esm-default');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);␊
      var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);␊
      var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);␊
      var require$$3__default = /*#__PURE__*/_interopDefaultLegacy(require$$3);␊
      var require$$4__default = /*#__PURE__*/_interopDefaultLegacy(require$$4);␊
      ␊
      var main = {};␊
      ␊
      const externalExports = require$$0__default["default"];␊
      const externalModuleExports = require$$1__default["default"];␊
      const externalNamed = require$$2__default["default"];␊
      const externalMixed = require$$3__default["default"];␊
      const externalDefault = require$$4__default["default"];␊
      ␊
      t.deepEqual(externalExports, { foo: 'foo' }, 'external exports');␊
      t.deepEqual(externalModuleExports, 'bar', 'external module exports');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, 'bar', 'external mixed');␊
      t.deepEqual(externalDefault, 'bar', 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## esm-mixed-exports-function-default

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getAugmentedNamespace(n) {␊
        var f = n.default;␊
      	if (typeof f == "function") {␊
      		var a = function () {␊
      			return f.apply(this, arguments);␊
      		};␊
      		a.prototype = f.prototype;␊
        } else a = {};␊
        Object.defineProperty(a, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      function foo$1(...args) {␊
        return args;␊
      }␊
      ␊
      const bar$1 = 'bar';␊
      ␊
      var esmFunction = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	'default': foo$1,␊
      	bar: bar$1␊
      });␊
      ␊
      var require$$0 = /*@__PURE__*/getAugmentedNamespace(esmFunction);␊
      ␊
      function Foo$1(...args) {␊
        this.foo = args;␊
      }␊
      ␊
      Foo$1.prototype.update = function () {␊
        this.foo = 'updated';␊
      };␊
      ␊
      const bar = 'bar';␊
      ␊
      var esmConstructor = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	'default': Foo$1,␊
      	bar: bar␊
      });␊
      ␊
      var require$$1 = /*@__PURE__*/getAugmentedNamespace(esmConstructor);␊
      ␊
      const foo = require$$0;␊
      const Foo = require$$1;␊
      ␊
      t.is(foo.bar, 'bar');␊
      t.deepEqual(foo.default('first'), ['first']);␊
      t.deepEqual(foo('second'), ['second']);␊
      ␊
      t.is(Foo.bar, 'bar');␊
      ␊
      // eslint-disable-next-line new-cap␊
      const newDefault = new Foo.default('third');␊
      t.deepEqual(newDefault.foo, ['third']);␊
      newDefault.update();␊
      t.is(newDefault.foo, 'updated');␊
      ␊
      const newFoo = new Foo('fourth');␊
      t.deepEqual(newFoo.foo, ['fourth']);␊
      newFoo.update();␊
      t.is(newFoo.foo, 'updated');␊
      ␊
      module.exports = main;␊
      `,
    }

## export-default-from

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var require$$0 = 'default export';␊
      ␊
      t.is(require$$0, 'default export');␊
      ␊
      module.exports = main;␊
      `,
    }

## exports

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var foo = {};␊
      ␊
      foo.bar = 'BAR';␊
      foo.baz = 'BAZ';␊
      ␊
      const { bar } = foo;␊
      const { baz } = foo;␊
      ␊
      var main = bar + baz;␊
      ␊
      module.exports = main;␊
      `,
    }

## exports-with-reassigned-module-exports

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep$1 = {exports: {}};␊
      ␊
      (function (module, exports) {␊
      	exports.foo = 'foo';␊
      	module.exports = { replaced: true };␊
      	exports.bar = 'bar';␊
      } (dep$1, dep$1.exports));␊
      ␊
      const dep = dep$1.exports;␊
      ␊
      t.deepEqual(dep, { replaced: true });␊
      ␊
      module.exports = main;␊
      `,
    }

## expose-file-type-detection

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var other = require('./other-aeb2ae1d.js');␊
      ␊
      t.is(other.other, 'foo');␊
      `,
      'other-aeb2ae1d.js': `'use strict';␊
      ␊
      var other = 'foo';␊
      ␊
      exports.other = other;␊
      `,
      'other.js': `'use strict';␊
      ␊
      var other = require('./other-aeb2ae1d.js');␊
      ␊
      ␊
      ␊
      module.exports = other.other;␊
      `,
    }

## external-imports

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$$0 = require('foo');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);␊
      ␊
      const foo = require$$0__default["default"];␊
      ␊
      var main = foo;␊
      ␊
      module.exports = main;␊
      `,
    }

## fallback-no-default

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getAugmentedNamespace(n) {␊
        var f = n.default;␊
      	if (typeof f == "function") {␊
      		var a = function () {␊
      			return f.apply(this, arguments);␊
      		};␊
      		a.prototype = f.prototype;␊
        } else a = {};␊
        Object.defineProperty(a, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable */␊
      var one = 1;␊
      ␊
      var two = 2;␊
      ␊
      var foo$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	one: one,␊
      	two: two␊
      });␊
      ␊
      var require$$0 = /*@__PURE__*/getAugmentedNamespace(foo$1);␊
      ␊
      const foo = require$$0;␊
      ␊
      t.is(foo.one, 1);␊
      t.is(foo.two, 2);␊
      ␊
      module.exports = main;␊
      `,
    }

## global-not-overwritten

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      Object.defineProperty(exports, '__esModule', { value: true });␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      var encode = {};␊
      ␊
      (function (exports) {␊
      	exports.encodeURIComponent = function () {␊
      	  return encodeURIComponent(this.str);␊
      	};␊
      ␊
      	// to ensure module is wrapped␊
      	commonjsGlobal.foo = exports;␊
      } (encode));␊
      ␊
      /* eslint-disable */␊
      ␊
      const foo = {␊
        str: 'test string',␊
        encodeURIComponent: encode.encodeURIComponent␊
      };␊
      ␊
      var encoded = foo.encodeURIComponent();␊
      ␊
      exports.encoded = encoded;␊
      `,
    }

## global-var

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      /* eslint-disable */␊
      ␊
      function foo() {␊
        const global = {};␊
        global.modified = true;␊
        return global;␊
      }␊
      ␊
      const notGlobal = foo();␊
      t.truthy(notGlobal.modified);␊
      t.truthy(!commonjsGlobal.modified);␊
      ␊
      var main = {};␊
      ␊
      module.exports = main;␊
      `,
    }

## import-esm-require-returns-default-auto

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var externalEsmNamed = require('external-esm-named');␊
      var externalEsmMixed = require('external-esm-mixed');␊
      var externalEsmDefault = require('external-esm-default');␊
      ␊
      function _interopNamespace(e) {␊
      	if (e && e.__esModule) return e;␊
      	var n = Object.create(null);␊
      	if (e) {␊
      		Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default') {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () { return e[k]; }␊
      				});␊
      			}␊
      		});␊
      	}␊
      	n["default"] = e;␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var externalEsmNamed__namespace = /*#__PURE__*/_interopNamespace(externalEsmNamed);␊
      var externalEsmMixed__namespace = /*#__PURE__*/_interopNamespace(externalEsmMixed);␊
      var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespace(externalEsmDefault);␊
      ␊
      function getDefaultExportFromNamespaceIfNotNamed (n) {␊
      	return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;␊
      }␊
      ␊
      var main = {};␊
      ␊
      var require$$0 = /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(externalEsmNamed__namespace);␊
      ␊
      var require$$1 = /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(externalEsmMixed__namespace);␊
      ␊
      var require$$2 = /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(externalEsmDefault__namespace);␊
      ␊
      const foo$1 = 'foo';␊
      ␊
      var named = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo$1␊
      });␊
      ␊
      const foo = 'foo';␊
      var mixed = 'bar';␊
      ␊
      var mixed$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo,␊
      	'default': mixed␊
      });␊
      ␊
      var require$$5 = 'bar';␊
      ␊
      var none = {};␊
      ␊
      const externalNamed = require$$0;␊
      const externalMixed = require$$1;␊
      const externalDefault = require$$2;␊
      ␊
      const namedExports = named;␊
      const mixedExports = mixed$1;␊
      const defaultExport = require$$5;␊
      const noExports = none;␊
      ␊
      t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊
      t.deepEqual(mixedExports, { foo: 'foo', default: 'bar' }, 'mixed exports');␊
      t.deepEqual(defaultExport, 'bar', 'default export');␊
      t.deepEqual(noExports, {}, 'no exports');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, { foo: 'foo', default: 'bar' }, 'external mixed');␊
      t.deepEqual(externalDefault, 'bar', 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## import-esm-require-returns-default-false

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var externalEsmNamed = require('external-esm-named');␊
      var externalEsmMixed = require('external-esm-mixed');␊
      var externalEsmDefault = require('external-esm-default');␊
      ␊
      function _interopNamespace(e) {␊
      	if (e && e.__esModule) return e;␊
      	var n = Object.create(null);␊
      	if (e) {␊
      		Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default') {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () { return e[k]; }␊
      				});␊
      			}␊
      		});␊
      	}␊
      	n["default"] = e;␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var externalEsmNamed__namespace = /*#__PURE__*/_interopNamespace(externalEsmNamed);␊
      var externalEsmMixed__namespace = /*#__PURE__*/_interopNamespace(externalEsmMixed);␊
      var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespace(externalEsmDefault);␊
      ␊
      function getAugmentedNamespace(n) {␊
        var f = n.default;␊
      	if (typeof f == "function") {␊
      		var a = function () {␊
      			return f.apply(this, arguments);␊
      		};␊
      		a.prototype = f.prototype;␊
        } else a = {};␊
        Object.defineProperty(a, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      var require$$0 = /*@__PURE__*/getAugmentedNamespace(externalEsmNamed__namespace);␊
      ␊
      var require$$1 = /*@__PURE__*/getAugmentedNamespace(externalEsmMixed__namespace);␊
      ␊
      var require$$2 = /*@__PURE__*/getAugmentedNamespace(externalEsmDefault__namespace);␊
      ␊
      const foo$1 = 'foo';␊
      ␊
      var named = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo$1␊
      });␊
      ␊
      var require$$3 = /*@__PURE__*/getAugmentedNamespace(named);␊
      ␊
      const foo = 'foo';␊
      var mixed = 'bar';␊
      ␊
      var mixed$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo,␊
      	'default': mixed␊
      });␊
      ␊
      var require$$4 = /*@__PURE__*/getAugmentedNamespace(mixed$1);␊
      ␊
      var _default = 'bar';␊
      ␊
      var _default$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	'default': _default␊
      });␊
      ␊
      var require$$5 = /*@__PURE__*/getAugmentedNamespace(_default$1);␊
      ␊
      var none = {};␊
      ␊
      const externalNamed = require$$0;␊
      const externalMixed = require$$1;␊
      const externalDefault = require$$2;␊
      ␊
      const namedExports = require$$3;␊
      const mixedExports = require$$4;␊
      const defaultExport = require$$5;␊
      const noExports = none;␊
      ␊
      t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊
      t.deepEqual(mixedExports, { foo: 'foo', default: 'bar' }, 'mixed exports');␊
      t.deepEqual(defaultExport, { default: 'bar' }, 'default export');␊
      t.deepEqual(noExports, {}, 'no exports');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, { foo: 'foo', default: 'bar' }, 'external mixed');␊
      t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊
      ␊
      /* eslint-disable no-prototype-builtins */␊
      t.is(namedExports.hasOwnProperty('foo'), true);␊
      t.is(mixedExports.hasOwnProperty('foo'), true);␊
      t.is(defaultExport.hasOwnProperty('foo'), false);␊
      t.is(externalNamed.hasOwnProperty('foo'), true);␊
      t.is(externalMixed.hasOwnProperty('foo'), true);␊
      t.is(externalDefault.hasOwnProperty('foo'), false);␊
      ␊
      module.exports = main;␊
      `,
    }

## import-esm-require-returns-default-function

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getAugmentedNamespace(n) {␊
        var f = n.default;␊
      	if (typeof f == "function") {␊
      		var a = function () {␊
      			return f.apply(this, arguments);␊
      		};␊
      		a.prototype = f.prototype;␊
        } else a = {};␊
        Object.defineProperty(a, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      var dep_false_default_ = 'default';␊
      ␊
      var dep_false_default_$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	'default': dep_false_default_␊
      });␊
      ␊
      var require$$0 = /*@__PURE__*/getAugmentedNamespace(dep_false_default_$1);␊
      ␊
      var dep_false_mixed_ = 'default'; const named$4 = 'named';␊
      ␊
      var dep_false_mixed_$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	'default': dep_false_mixed_,␊
      	named: named$4␊
      });␊
      ␊
      var require$$1 = /*@__PURE__*/getAugmentedNamespace(dep_false_mixed_$1);␊
      ␊
      const named$3 = 'named';␊
      ␊
      var dep_false_named_ = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	named: named$3␊
      });␊
      ␊
      var require$$2 = /*@__PURE__*/getAugmentedNamespace(dep_false_named_);␊
      ␊
      var require$$3 = 'default';␊
      ␊
      var dep_auto_mixed_ = 'default'; const named$2 = 'named';␊
      ␊
      var dep_auto_mixed_$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	'default': dep_auto_mixed_,␊
      	named: named$2␊
      });␊
      ␊
      const named$1 = 'named';␊
      ␊
      var dep_auto_named_ = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	named: named$1␊
      });␊
      ␊
      var require$$6 = 'default';␊
      ␊
      var require$$7 = 'default';␊
      ␊
      const named = 'named';␊
      ␊
      var dep_preferred_named_ = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	named: named␊
      });␊
      ␊
      var require$$9 = 'default';␊
      ␊
      var require$$10 = 'default';␊
      ␊
      const falseDefault = require$$0;␊
      const falseMixed = require$$1;␊
      const falseNamed = require$$2;␊
      ␊
      const autoDefault = require$$3;␊
      const autoMixed = dep_auto_mixed_$1;␊
      const autoNamed = dep_auto_named_;␊
      ␊
      const preferredDefault = require$$6;␊
      const preferredMixed = require$$7;␊
      const preferredNamed = dep_preferred_named_;␊
      ␊
      const trueDefault = require$$9;␊
      const trueMixed = require$$10;␊
      ␊
      t.deepEqual(falseDefault, { default: 'default' }, 'false default');␊
      t.deepEqual(falseMixed, { default: 'default', named: 'named' }, 'false mixed');␊
      t.deepEqual(falseNamed, { named: 'named' }, 'false named');␊
      ␊
      t.deepEqual(autoDefault, 'default', 'auto default');␊
      t.deepEqual(autoMixed, { default: 'default', named: 'named' }, 'auto mixed');␊
      t.deepEqual(autoNamed, { named: 'named' }, 'auto named');␊
      ␊
      t.deepEqual(preferredDefault, 'default', 'preferred default');␊
      t.deepEqual(preferredMixed, 'default', 'preferred mixed');␊
      t.deepEqual(preferredNamed, { named: 'named' }, 'preferred named');␊
      ␊
      t.deepEqual(trueDefault, 'default', 'true default');␊
      t.deepEqual(trueMixed, 'default', 'true mixed');␊
      ␊
      module.exports = main;␊
      `,
    }

## import-esm-require-returns-default-function-called-once

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main$1 = {};␊
      ␊
      var require$$0 = 'other.js';␊
      ␊
      var require$$2 = 'both.js';␊
      ␊
      const other = require$$0;␊
      const both$1 = require$$2;␊
      ␊
      t.deepEqual(other, 'other.js', 'other other');␊
      t.deepEqual(both$1, 'both.js', 'other both');␊
      ␊
      var require$$1 = 'main.js';␊
      ␊
      const main = require$$1;␊
      const both = require$$2;␊
      ␊
      t.deepEqual(main, 'main.js', 'main main');␊
      t.deepEqual(both, 'both.js', 'main both');␊
      ␊
      module.exports = main$1;␊
      `,
    }

## import-esm-require-returns-default-function-external

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var externalEsmNamed = require('external-esm-named');␊
      var require$$1 = require('external-esm-mixed');␊
      var externalEsmDefault = require('external-esm-default');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      function _interopNamespace(e) {␊
      	if (e && e.__esModule) return e;␊
      	var n = Object.create(null);␊
      	if (e) {␊
      		Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default') {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () { return e[k]; }␊
      				});␊
      			}␊
      		});␊
      	}␊
      	n["default"] = e;␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var externalEsmNamed__namespace = /*#__PURE__*/_interopNamespace(externalEsmNamed);␊
      var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);␊
      var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespace(externalEsmDefault);␊
      ␊
      function getDefaultExportFromNamespaceIfNotNamed (n) {␊
      	return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;␊
      }␊
      ␊
      function getAugmentedNamespace(n) {␊
        var f = n.default;␊
      	if (typeof f == "function") {␊
      		var a = function () {␊
      			return f.apply(this, arguments);␊
      		};␊
      		a.prototype = f.prototype;␊
        } else a = {};␊
        Object.defineProperty(a, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      var require$$0 = /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(externalEsmNamed__namespace);␊
      ␊
      var require$$2 = /*@__PURE__*/getAugmentedNamespace(externalEsmDefault__namespace);␊
      ␊
      const externalNamed = require$$0;␊
      const externalMixed = require$$1__default["default"];␊
      const externalDefault = require$$2;␊
      ␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'named');␊
      t.deepEqual(externalMixed, 'bar', 'mixed');␊
      t.deepEqual(externalDefault, { default: 'bar' }, 'default');␊
      ␊
      module.exports = main;␊
      `,
    }

## import-esm-require-returns-default-namespace

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var externalEsmNamed = require('external-esm-named');␊
      var externalEsmMixed = require('external-esm-mixed');␊
      var externalEsmDefault = require('external-esm-default');␊
      ␊
      function _interopNamespace(e) {␊
      	if (e && e.__esModule) return e;␊
      	var n = Object.create(null);␊
      	if (e) {␊
      		Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default') {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () { return e[k]; }␊
      				});␊
      			}␊
      		});␊
      	}␊
      	n["default"] = e;␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var externalEsmNamed__namespace = /*#__PURE__*/_interopNamespace(externalEsmNamed);␊
      var externalEsmMixed__namespace = /*#__PURE__*/_interopNamespace(externalEsmMixed);␊
      var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespace(externalEsmDefault);␊
      ␊
      var main = {};␊
      ␊
      const foo$1 = 'foo';␊
      ␊
      var named = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo$1␊
      });␊
      ␊
      const foo = 'foo';␊
      var mixed = 'bar';␊
      ␊
      var mixed$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo,␊
      	'default': mixed␊
      });␊
      ␊
      var _default = 'bar';␊
      ␊
      var _default$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	'default': _default␊
      });␊
      ␊
      var none = {};␊
      ␊
      const externalNamed = externalEsmNamed__namespace;␊
      const externalMixed = externalEsmMixed__namespace;␊
      const externalDefault = externalEsmDefault__namespace;␊
      ␊
      const namedExports = named;␊
      const mixedExports = mixed$1;␊
      const defaultExport = _default$1;␊
      const noExports = none;␊
      ␊
      t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊
      t.deepEqual(mixedExports, { foo: 'foo', default: 'bar' }, 'mixed exports');␊
      t.deepEqual(defaultExport, { default: 'bar' }, 'default export');␊
      t.deepEqual(noExports, {}, 'no exports');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, { foo: 'foo', default: 'bar' }, 'external mixed');␊
      t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## import-esm-require-returns-default-preferred

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var externalEsmNamed = require('external-esm-named');␊
      var externalEsmMixed = require('external-esm-mixed');␊
      var externalEsmDefault = require('external-esm-default');␊
      ␊
      function _interopNamespace(e) {␊
      	if (e && e.__esModule) return e;␊
      	var n = Object.create(null);␊
      	if (e) {␊
      		Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default') {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () { return e[k]; }␊
      				});␊
      			}␊
      		});␊
      	}␊
      	n["default"] = e;␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var externalEsmNamed__namespace = /*#__PURE__*/_interopNamespace(externalEsmNamed);␊
      var externalEsmMixed__namespace = /*#__PURE__*/_interopNamespace(externalEsmMixed);␊
      var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespace(externalEsmDefault);␊
      ␊
      function getDefaultExportFromNamespaceIfPresent (n) {␊
      	return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;␊
      }␊
      ␊
      var main = {};␊
      ␊
      var require$$0 = /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(externalEsmNamed__namespace);␊
      ␊
      var require$$1 = /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(externalEsmMixed__namespace);␊
      ␊
      var require$$2 = /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(externalEsmDefault__namespace);␊
      ␊
      const foo = 'foo';␊
      ␊
      var named = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo␊
      });␊
      ␊
      var require$$4 = 'bar';␊
      ␊
      var require$$5 = 'bar';␊
      ␊
      var none = {};␊
      ␊
      const externalNamed = require$$0;␊
      const externalMixed = require$$1;␊
      const externalDefault = require$$2;␊
      ␊
      const namedExports = named;␊
      const mixedExports = require$$4;␊
      const defaultExport = require$$5;␊
      const noExports = none;␊
      ␊
      t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊
      t.deepEqual(mixedExports, 'bar', 'mixed exports');␊
      t.deepEqual(defaultExport, 'bar', 'default export');␊
      t.deepEqual(noExports, {}, 'no exports');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, 'bar', 'external mixed');␊
      t.deepEqual(externalDefault, 'bar', 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## import-esm-require-returns-default-true

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$$0 = require('external-esm-named');␊
      var require$$1 = require('external-esm-mixed');␊
      var require$$2 = require('external-esm-default');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);␊
      var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);␊
      var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);␊
      ␊
      var main = {};␊
      ␊
      var require$$3 = 'bar';␊
      ␊
      var require$$4 = 'bar';␊
      ␊
      const externalNamed = require$$0__default["default"];␊
      const externalMixed = require$$1__default["default"];␊
      const externalDefault = require$$2__default["default"];␊
      ␊
      const mixedExports = require$$3;␊
      const defaultExport = require$$4;␊
      ␊
      t.deepEqual(mixedExports, 'bar', 'mixed exports');␊
      t.deepEqual(defaultExport, 'bar', 'default export');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, 'bar', 'external mixed');␊
      t.deepEqual(externalDefault, 'bar', 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## import-esm-require-returns-default-undefined

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var externalEsmNamed = require('external-esm-named');␊
      var externalEsmMixed = require('external-esm-mixed');␊
      var externalEsmDefault = require('external-esm-default');␊
      ␊
      function _interopNamespace(e) {␊
      	if (e && e.__esModule) return e;␊
      	var n = Object.create(null);␊
      	if (e) {␊
      		Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default') {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () { return e[k]; }␊
      				});␊
      			}␊
      		});␊
      	}␊
      	n["default"] = e;␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var externalEsmNamed__namespace = /*#__PURE__*/_interopNamespace(externalEsmNamed);␊
      var externalEsmMixed__namespace = /*#__PURE__*/_interopNamespace(externalEsmMixed);␊
      var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespace(externalEsmDefault);␊
      ␊
      function getAugmentedNamespace(n) {␊
        var f = n.default;␊
      	if (typeof f == "function") {␊
      		var a = function () {␊
      			return f.apply(this, arguments);␊
      		};␊
      		a.prototype = f.prototype;␊
        } else a = {};␊
        Object.defineProperty(a, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      var require$$0 = /*@__PURE__*/getAugmentedNamespace(externalEsmNamed__namespace);␊
      ␊
      var require$$1 = /*@__PURE__*/getAugmentedNamespace(externalEsmMixed__namespace);␊
      ␊
      var require$$2 = /*@__PURE__*/getAugmentedNamespace(externalEsmDefault__namespace);␊
      ␊
      const foo$1 = 'foo';␊
      ␊
      var named = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo$1␊
      });␊
      ␊
      var require$$3 = /*@__PURE__*/getAugmentedNamespace(named);␊
      ␊
      const foo = 'foo';␊
      var mixed = 'bar';␊
      ␊
      var mixed$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo,␊
      	'default': mixed␊
      });␊
      ␊
      var require$$4 = /*@__PURE__*/getAugmentedNamespace(mixed$1);␊
      ␊
      var _default = 'bar';␊
      ␊
      var _default$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	'default': _default␊
      });␊
      ␊
      var require$$5 = /*@__PURE__*/getAugmentedNamespace(_default$1);␊
      ␊
      var none = {};␊
      ␊
      const externalNamed = require$$0;␊
      const externalMixed = require$$1;␊
      const externalDefault = require$$2;␊
      ␊
      const namedExports = require$$3;␊
      const mixedExports = require$$4;␊
      const defaultExport = require$$5;␊
      const noExports = none;␊
      ␊
      t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊
      t.deepEqual(mixedExports, { foo: 'foo', default: 'bar' }, 'mixed exports');␊
      t.deepEqual(defaultExport, { default: 'bar' }, 'default export');␊
      t.deepEqual(noExports, {}, 'no exports');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, { foo: 'foo', default: 'bar' }, 'external mixed');␊
      t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## import-esm-with-interop

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getAugmentedNamespace(n) {␊
        var f = n.default;␊
      	if (typeof f == "function") {␊
      		var a = function () {␊
      			return f.apply(this, arguments);␊
      		};␊
      		a.prototype = f.prototype;␊
        } else a = {};␊
        Object.defineProperty(a, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-mutable-exports */␊
      let foo = 'foo';␊
      let bar = 'bar';␊
      ␊
      function update(newFoo, newBar) {␊
        foo = newFoo;␊
        bar = newBar;␊
      }␊
      ␊
      var lib$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	get default () { return foo; },␊
      	get bar () { return bar; },␊
      	update: update␊
      });␊
      ␊
      var require$$0 = /*@__PURE__*/getAugmentedNamespace(lib$1);␊
      ␊
      /* eslint-disable */␊
      ␊
      var lib = require$$0;␊
      ␊
      function _interopDefault$1(e) {␊
        return e && e.__esModule ? e : { default: e };␊
      }␊
      ␊
      var lib__default = /*#__PURE__*/_interopDefault$1(lib);␊
      t.is(lib__default['default'], 'foo');␊
      t.is(lib.bar, 'bar');␊
      ␊
      lib.update('newFoo', 'newBar');␊
      t.is(lib__default['default'], 'newFoo');␊
      t.is(lib.bar, 'newBar');␊
      ␊
      module.exports = main;␊
      `,
    }

## index

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var foo$1 = 42;␊
      ␊
      const foo = foo$1;␊
      ␊
      t.is(foo, 42);␊
      ␊
      module.exports = main;␊
      `,
    }

## inline

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var multiply;␊
      var hasRequiredMultiply;␊
      ␊
      function requireMultiply () {␊
      	if (hasRequiredMultiply) return multiply;␊
      	hasRequiredMultiply = 1;␊
      	multiply = function (a, b) {␊
      	  return a * b;␊
      	};␊
      	return multiply;␊
      }␊
      ␊
      var foo;␊
      var hasRequiredFoo;␊
      ␊
      function requireFoo () {␊
      	if (hasRequiredFoo) return foo;␊
      	hasRequiredFoo = 1;␊
      	foo = 1;␊
      	return foo;␊
      }␊
      ␊
      /* eslint-disable global-require */␊
      ␊
      var main = function () {␊
        return requireMultiply()(2, requireFoo());␊
      };␊
      ␊
      module.exports = main;␊
      `,
    }

## interop-esmodule-wrapped

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getDefaultExportFromCjs (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      var other = {exports: {}};␊
      ␊
      (function (module, exports) {␊
      	exports.default = 42;␊
      ␊
      	addCompiledMarker(module.exports);␊
      ␊
      	function addCompiledMarker(exports) {␊
      	  // eslint-disable-next-line no-param-reassign␊
      	  exports.__esModule = true;␊
      	}␊
      } (other, other.exports));␊
      ␊
      var foo = /*@__PURE__*/getDefaultExportFromCjs(other.exports);␊
      ␊
      t.deepEqual(foo, 42);␊
      `,
    }

## interop-no-esmodule-wrapped

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var other = {exports: {}};␊
      ␊
      (function (module) {␊
      	addDefaultExport(module.exports);␊
      ␊
      	function addDefaultExport(exports) {␊
      	  // eslint-disable-next-line no-param-reassign␊
      	  exports.default = 42;␊
      	}␊
      } (other));␊
      ␊
      var foo = other.exports;␊
      ␊
      t.deepEqual(foo, { default: 42 });␊
      `,
    }

## interop-without-default-unwrapped

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var other = {};␊
      ␊
      other.foo = '__esModule';␊
      ␊
      t.deepEqual(other, { foo: '__esModule' });␊
      `,
    }

## late-entry-dependency

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var other = require('./other2.js');␊
      ␊
      var main = {};␊
      ␊
      const foo = other.other;␊
      ␊
      t.is(foo, 'foo');␊
      ␊
      module.exports = main;␊
      `,
      'other.js': `'use strict';␊
      ␊
      var other = require('./other2.js');␊
      ␊
      ␊
      ␊
      module.exports = other.other;␊
      `,
      'other2.js': `'use strict';␊
      ␊
      var other = 'foo';␊
      ␊
      exports.other = other;␊
      `,
    }

## leading-comment

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      /*␊
       * This comment could be really important and should not be removed␊
       */␊
      ␊
      var main = 'bar';␊
      ␊
      module.exports = main;␊
      `,
    }

## leading-comment-imports

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$$0 = require('external-cjs-exports');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);␊
      ␊
      var main = {};␊
      ␊
      /*␊
       * This comment could be really important and should not be removed␊
       */␊
      ␊
      const externalExports = require$$0__default["default"];␊
      ␊
      t.is(externalExports.foo, 'foo');␊
      ␊
      module.exports = main;␊
      `,
    }

## leading-comment-wrapped

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      /*␊
       * This comment could be really important and should not be removed␊
       */␊
      ␊
      (function (exports) {␊
      ␊
      	modifyExports(exports);␊
      ␊
      	function modifyExports(exported) {␊
      	  // eslint-disable-next-line no-param-reassign␊
      	  exported.foo = 'bar';␊
      	}␊
      } (main));␊
      ␊
      module.exports = main;␊
      `,
    }

## load-cycle-parallel

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      module.exports = main;␊
      `,
    }

## module-meta-properties

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep$1 = {};␊
      ␊
      dep$1.foo = 'foo';␊
      ␊
      const dep = dep$1;␊
      ␊
      t.is(dep.foo, 'foo');␊
      ␊
      module.exports = main;␊
      `,
    }

## module-side-effects-late-entry

> Snapshot 1

    {
      'generated-foo.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      // This side-effect will only be respected if this is an entry point␊
      commonjsGlobal.foo = 'foo';␊
      `,
      'generated-foo2.js': `'use strict';␊
      ␊
      require('./generated-foo.js');␊
      ␊
      var foo = {};␊
      ␊
      module.exports = foo;␊
      `,
      'main.js': `'use strict';␊
      ␊
      require('./generated-foo.js');␊
      ␊
      var main = 'main';␊
      ␊
      module.exports = main;␊
      `,
    }

## module_require

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var foo$1 = 21;␊
      ␊
      const foo = foo$1;␊
      ␊
      var main = foo * 2;␊
      ␊
      module.exports = main;␊
      `,
    }

## multiple-define-compiled-esm

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var foo = {};␊
      ␊
      Object.defineProperty(foo, '__esModule', { value: true });␊
      ␊
      Object.defineProperty(foo, '__esModule', { value: true });␊
      ␊
      var _default = foo.default = 'foo';␊
      ␊
      t.deepEqual(_default, 'foo');␊
      `,
    }

## named-exports

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var a = 1;␊
      var b = 2;␊
      ␊
      t.is(a, 1);␊
      t.is(b, 2);␊
      `,
    }

## named-exports-conditional

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var x = {exports: {}};␊
      ␊
      if (typeof someUnknownGlobal !== 'undefined') {␊
        x.exports = { named: 'bar' };␊
      } else {␊
        x.exports = { named: 'foo' };␊
      }␊
      ␊
      t.is(x.exports.named, 'foo');␊
      `,
    }

## named-exports-dynamic

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var x = {exports: {}};␊
      ␊
      (function (module) {␊
      	window.addExport = (key, value) => {␊
      	  module.exports[key] = value;␊
      	};␊
      } (x));␊
      ␊
      t.is(x.exports.named, undefined);␊
      ␊
      window.addExport('named', 'foo');␊
      ␊
      t.is(x.exports.named, 'foo');␊
      `,
    }

## named-exports-object-define

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var x = {exports: {}};␊
      ␊
      (function (module) {␊
      	Object.defineProperty(module.exports, 'named', {␊
      	  enumerable: true,␊
      	  get: function get() {␊
      	    return 'foo';␊
      	  }␊
      	});␊
      } (x));␊
      ␊
      t.is(x.exports.named, 'foo');␊
      `,
    }

## named-exports-reexport-default

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var reexport = {exports: {}};␊
      ␊
      var _export = {};␊
      ␊
      _export.named = 2;␊
      ␊
      (function (module) {␊
      	module.exports = _export;␊
      } (reexport));␊
      ␊
      t.is(reexport.exports.named, 2);␊
      `,
    }

## named-exports-reexport-named

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var _export = {};␊
      ␊
      _export.named = 2;␊
      ␊
      const myModule = _export;␊
      ␊
      var named = myModule.named;␊
      ␊
      t.is(named, 2);␊
      `,
    }

## named-exports-unexported

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var x = {};␊
      ␊
      x.named = 2;␊
      ␊
      t.is(x.nonExisting, undefined);␊
      `,
    }

## nested-define-compiled-esm-unused

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getDefaultExportFromCjs (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      var foo$1 = {};␊
      ␊
      (function (exports) {␊
      ␊
      	exports.default = 'foo';␊
      } (foo$1));␊
      ␊
      var foo = /*@__PURE__*/getDefaultExportFromCjs(foo$1);␊
      ␊
      t.deepEqual(foo, { default: 'foo' });␊
      `,
    }

## nested-define-compiled-esm-used

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getDefaultExportFromCjs (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      var foo$1 = {};␊
      ␊
      (function (exports) {␊
      	Object.defineProperty(exports, '__esModule', { value: true });␊
      ␊
      	{␊
      	  Object.defineProperty(exports, '__esModule', { value: true });␊
      	}␊
      ␊
      	exports.default = 'foo';␊
      } (foo$1));␊
      ␊
      var foo = /*@__PURE__*/getDefaultExportFromCjs(foo$1);␊
      ␊
      t.deepEqual(foo, 'foo');␊
      `,
    }

## nested-named-export-assignments

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var dep1 = {};␊
      ␊
      dep1.foo = 'first';␊
      ␊
      reassignSomeExports$1();␊
      reassignSomeMoreExports$1();␊
      ␊
      function reassignSomeExports$1() {␊
        dep1.foo = 'second';␊
        dep1.bar = 'first';␊
      }␊
      ␊
      function reassignSomeMoreExports$1() {␊
        dep1.bar = 'second';␊
      }␊
      ␊
      var bar;␊
      var foo = 'first';␊
      ␊
      reassignSomeExports();␊
      reassignSomeMoreExports();␊
      ␊
      function reassignSomeExports() {␊
        foo = 'second';␊
        bar = 'first';␊
      }␊
      ␊
      function reassignSomeMoreExports() {␊
        bar = 'second';␊
      }␊
      ␊
      t.is(dep1.foo, 'second');␊
      t.is(dep1.bar, 'second');␊
      t.is(foo, 'second');␊
      t.is(bar, 'second');␊
      `,
    }

## no-exports-entry

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep$1 = 42;␊
      ␊
      const dep = dep$1;␊
      ␊
      t.is(dep, 42);␊
      ␊
      module.exports = main;␊
      `,
    }

## no-side-effects

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep$1 = {};␊
      ␊
      dep$1.foo = 'bar';␊
      ␊
      const dep = dep$1;␊
      ␊
      t.is(dep.foo, 'bar');␊
      ␊
      module.exports = main;␊
      `,
    }

## only-nested-module-exports-reassignment

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep1$1 = {exports: {}};␊
      ␊
      if (reassignFirstModuleExports) {␊
        dep1$1.exports = 'reassigned';␊
      }␊
      ␊
      var dep2$1 = {exports: {}};␊
      ␊
      if (reassignSecondModuleExports) {␊
        dep2$1.exports = 'reassigned';␊
      }␊
      ␊
      const dep1 = dep1$1.exports;␊
      const dep2 = dep2$1.exports;␊
      ␊
      t.is(dep1, 'reassigned');␊
      t.deepEqual(dep2, {});␊
      ␊
      module.exports = main;␊
      `,
    }

## ordering

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var shared$2 = {␊
        fooLoaded: false␊
      };␊
      ␊
      const shared$1 = shared$2;␊
      ␊
      // Mutate the shared module␊
      shared$1.fooLoaded = true;␊
      ␊
      const shared = shared$2;␊
      ␊
      var bar = shared.fooLoaded;␊
      ␊
      const fooLoaded = bar;␊
      ␊
      t.truthy(fooLoaded);␊
      ␊
      module.exports = main;␊
      `,
    }

## pass-require-to-node-resolve

> Snapshot 1

    {
      'bar-imported-49e0dbcf.js': `'use strict';␊
      ␊
      var barImported = 'imported';␊
      ␊
      exports["default"] = barImported;␊
      `,
      'main.js': `'use strict';␊
      ␊
      var foo = 'imported';␊
      ␊
      var requiring = {};␊
      ␊
      var fooRequired = 'required';␊
      ␊
      requiring.foo = fooRequired;␊
      ␊
      requiring.barPromise = Promise.resolve().then(function () { return require('./bar-imported-49e0dbcf.js'); });␊
      ␊
      t.is(foo, 'imported');␊
      t.is(requiring.foo, 'required');␊
      ␊
      var main = Promise.all([Promise.resolve().then(function () { return require('./bar-imported-49e0dbcf.js'); }), requiring.barPromise]);␊
      ␊
      module.exports = main;␊
      `,
    }

## plugin-isentry

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      global.entryDetected = true;␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function getDefaultExportFromCjs (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      var main$1 = {exports: {}};␊
      ␊
      t.is(commonjsGlobal.entryDetected, true);␊
      var dep = 'dep';␊
      ␊
      (function (module) {␊
      	t.is(commonjsGlobal.entryDetected, true);␊
      	module.exports = dep;␊
      } (main$1));␊
      ␊
      var main = /*@__PURE__*/getDefaultExportFromCjs(main$1.exports);␊
      ␊
      module.exports = main;␊
      `,
      'other.js': `'use strict';␊
      ␊
      Object.defineProperty(exports, '__esModule', { value: true });␊
      ␊
      const other = true;␊
      ␊
      exports.other = other;␊
      `,
    }

## preserve-modules

> Snapshot 1

    {
      '_virtual/_commonjsHelpers.js': `'use strict';␊
      ␊
      Object.defineProperty(exports, '__esModule', { value: true });␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      exports.commonjsGlobal = commonjsGlobal;␊
      `,
      'main.js': `'use strict';␊
      ␊
      var main = require('./main2.js');␊
      ␊
      var mainExports = main.__require();␊
      ␊
      module.exports = mainExports;␊
      `,
      'main2.js': `'use strict';␊
      ␊
      Object.defineProperty(exports, '__esModule', { value: true });␊
      ␊
      var _commonjsHelpers = require('./_virtual/_commonjsHelpers.js');␊
      ␊
      var main;␊
      var hasRequiredMain;␊
      ␊
      function requireMain () {␊
      	if (hasRequiredMain) return main;␊
      	hasRequiredMain = 1;␊
      	_commonjsHelpers.commonjsGlobal.main = 'main';␊
      	console.log('main');␊
      ␊
      	main = 'main';␊
      	return main;␊
      }␊
      ␊
      exports.__require = requireMain;␊
      `,
    }

## react-apollo

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsBar = {};␊
      ␊
      /* eslint-disable no-underscore-dangle */␊
      ␊
      function Bar$1() {␊
        this.x = 42;␊
      }␊
      ␊
      commonjsBar.__esModule = true;␊
      commonjsBar.default = Bar$1;␊
      ␊
      /* eslint-disable no-underscore-dangle */␊
      ␊
      const Bar = commonjsBar;␊
      var Bar_1 = Bar.default;␊
      ␊
      t.is(new Bar_1().x, 42);␊
      `,
    }

## reassign-exports

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var identifier$1 = {};␊
      ␊
      (function (exports) {␊
      	exports = 'foo';␊
      	t.is(exports, 'foo');␊
      } (identifier$1));␊
      ␊
      var property$1 = {};␊
      ␊
      (function (exports) {␊
      	({ foo: exports } = { foo: 'foo' });␊
      	t.is(exports, 'foo');␊
      } (property$1));␊
      ␊
      var arrayPattern$1 = {};␊
      ␊
      (function (exports) {␊
      	[exports] = ['foo'];␊
      	t.is(exports, 'foo');␊
      } (arrayPattern$1));␊
      ␊
      var assignmentPattern$1 = {};␊
      ␊
      (function (exports) {␊
      	({ exports = 'foo' } = {});␊
      	t.is(exports, 'foo');␊
      } (assignmentPattern$1));␊
      ␊
      const identifier = identifier$1;␊
      const property = property$1;␊
      const arrayPattern = arrayPattern$1;␊
      const assignmentPattern = assignmentPattern$1;␊
      ␊
      t.deepEqual(identifier, {});␊
      t.deepEqual(property, {});␊
      t.deepEqual(arrayPattern, {});␊
      t.deepEqual(assignmentPattern, {});␊
      ␊
      module.exports = main;␊
      `,
    }

## reassign-module

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var identifier$1 = {exports: {}};␊
      ␊
      (function (module) {␊
      	// eslint-disable-next-line no-global-assign␊
      	module = 'foo';␊
      	t.is(module, 'foo');␊
      } (identifier$1));␊
      ␊
      var property$1 = {exports: {}};␊
      ␊
      (function (module) {␊
      	// eslint-disable-next-line no-global-assign␊
      	({ foo: module } = { foo: 'foo' });␊
      	t.is(module, 'foo');␊
      } (property$1));␊
      ␊
      var arrayPattern$1 = {exports: {}};␊
      ␊
      (function (module) {␊
      	// eslint-disable-next-line no-global-assign␊
      	[module] = ['foo'];␊
      	t.is(module, 'foo');␊
      } (arrayPattern$1));␊
      ␊
      var assignmentPattern$1 = {exports: {}};␊
      ␊
      (function (module) {␊
      	// eslint-disable-next-line no-global-assign␊
      	({ module = 'foo' } = {});␊
      	t.is(module, 'foo');␊
      } (assignmentPattern$1));␊
      ␊
      const identifier = identifier$1.exports;␊
      const property = property$1.exports;␊
      const arrayPattern = arrayPattern$1.exports;␊
      const assignmentPattern = assignmentPattern$1.exports;␊
      ␊
      t.deepEqual(identifier, {}, 'identifier');␊
      t.deepEqual(property, {}, 'property');␊
      t.deepEqual(arrayPattern, {}, 'arrayPattern');␊
      t.deepEqual(assignmentPattern, {}, 'assignmentPattern');␊
      ␊
      module.exports = main;␊
      `,
    }

## reassigned-module-exports-object

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep$1 = {exports: {}};␊
      ␊
      const exported = {};␊
      dep$1.exports = exported;␊
      dep$1.exports.foo = 'foo';␊
      ␊
      t.deepEqual(exported, { foo: 'foo' });␊
      ␊
      const dep = dep$1.exports;␊
      ␊
      t.deepEqual(dep, { foo: 'foo' });␊
      ␊
      module.exports = main;␊
      `,
    }

## reassignment

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      function foo$1() {}␊
      foo$1.something = false;␊
      ␊
      var foo_1 = foo$1;␊
      ␊
      let foo = foo_1;␊
      ␊
      if (!foo.something) {␊
        foo = function somethingElse() {};␊
        foo.something = true;␊
      }␊
      ␊
      t.truthy(foo.something);␊
      ␊
      module.exports = main;␊
      `,
    }

## relative-external

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$$0 = require('../fixtures/function/relative-external/external.js');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);␊
      ␊
      var main = {};␊
      ␊
      const { foo } = require$$0__default["default"];␊
      ␊
      t.is(foo, 'foo');␊
      ␊
      module.exports = main;␊
      `,
    }

## require-esm-with-named-namespace

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      const foo = 'foo';␊
      var other = 'bar';␊
      ␊
      var other$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo,␊
      	'default': other␊
      });␊
      ␊
      var dep$1 = 'default';␊
      ␊
      var dep$2 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	'default': dep$1,␊
      	ns: other$1␊
      });␊
      ␊
      const dep = dep$2;␊
      ␊
      t.deepEqual(dep, { default: 'default', ns: { default: 'bar', foo: 'foo' } });␊
      ␊
      module.exports = main;␊
      `,
    }

## require-esm-with-namespace-and-default

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      const foo = 'foo';␊
      ␊
      var dep$1 = 'default';␊
      ␊
      var dep$2 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	'default': dep$1,␊
      	foo: foo␊
      });␊
      ␊
      const dep = dep$2;␊
      ␊
      t.deepEqual(dep, { default: 'default', foo: 'foo' });␊
      ␊
      module.exports = main;␊
      `,
    }

## require-esm-with-namespace-named-default

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      const foo = 'foo';␊
      var other = 'bar';␊
      ␊
      var other$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo,␊
      	'default': other␊
      });␊
      ␊
      const dep = other$1;␊
      ␊
      t.deepEqual(dep, { default: 'bar', foo: 'foo' });␊
      ␊
      module.exports = main;␊
      `,
    }

## require-esm-with-namespace-prefer-default

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      const foo = 'foo';␊
      ␊
      var dep$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo␊
      });␊
      ␊
      const dep = dep$1;␊
      ␊
      t.deepEqual(dep, { foo: 'foo' });␊
      ␊
      module.exports = main;␊
      `,
    }

## require-snapshotting

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep$1 = {␊
        foo: 'foo',␊
        update: () => (dep$1 = { foo: 'bar' })␊
      };␊
      ␊
      const dep = dep$1;␊
      ␊
      t.is(dep.foo, 'foo');␊
      ␊
      dep.update();␊
      ␊
      t.is(dep.foo, 'foo');␊
      t.is(dep$1.foo, 'bar');␊
      ␊
      module.exports = main;␊
      `,
    }

## resolve-is-cjs-extension

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getAugmentedNamespace(n) {␊
        var f = n.default;␊
      	if (typeof f == "function") {␊
      		var a = function () {␊
      			return f.apply(this, arguments);␊
      		};␊
      		a.prototype = f.prototype;␊
        } else a = {};␊
        Object.defineProperty(a, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      const result = 'second';␊
      ␊
      var second = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	result: result␊
      });␊
      ␊
      var require$$0 = /*@__PURE__*/getAugmentedNamespace(second);␊
      ␊
      t.is(require$$0.result, 'second');␊
      ␊
      module.exports = main;␊
      `,
    }

## resolve-is-cjs-filtered

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getAugmentedNamespace(n) {␊
        var f = n.default;␊
      	if (typeof f == "function") {␊
      		var a = function () {␊
      			return f.apply(this, arguments);␊
      		};␊
      		a.prototype = f.prototype;␊
        } else a = {};␊
        Object.defineProperty(a, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      const result = 'second';␊
      ␊
      var second = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	result: result␊
      });␊
      ␊
      var require$$0 = /*@__PURE__*/getAugmentedNamespace(second);␊
      ␊
      t.is(require$$0.result, 'second');␊
      ␊
      module.exports = main;␊
      `,
    }

## shadowed-import

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var foo$1 = 'foo';␊
      ␊
      const foo = foo$1;␊
      ␊
      t.is(foo, 'foo');␊
      ␊
      {␊
        // eslint-disable-next-line no-shadow␊
        const foo = 'wrong';␊
        // eslint-disable-next-line global-require␊
        const bar = foo$1;␊
        t.is(foo, 'wrong');␊
        t.is(bar, 'foo');␊
      }␊
      ␊
      module.exports = main;␊
      `,
    }

## shadowing

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function foo(require) {␊
        require('not-an-actual-require-statement');␊
      }␊
      ␊
      let result;␊
      ␊
      foo((msg) => {␊
        result = msg;␊
      });␊
      ␊
      t.is(result, 'not-an-actual-require-statement');␊
      `,
    }

## shorthand-require

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function commonjsRequire(path) {␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      const HOST = {␊
        require: commonjsRequire␊
      };␊
      ␊
      var main = {␊
        HOST␊
      };␊
      ␊
      module.exports = main;␊
      `,
    }

## skips-dead-branches

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      Object.defineProperty(exports, '__esModule', { value: true });␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      var main = {};␊
      ␊
      commonjsGlobal.b = 2;␊
      var b = 'b';␊
      ␊
      /* eslint-disable */␊
      ␊
      var conditionalTrue = main.conditionalTrue = b ;␊
      var conditionalFalse = main.conditionalFalse = b;␊
      var logicalAnd1 = main.logicalAnd1 = b;␊
      var logicalAnd2 = main.logicalAnd2 = false ;␊
      var logicalOr1 = main.logicalOr1 = true ;␊
      var logicalOr2 = main.logicalOr2 = b;␊
      ␊
      exports.conditionalFalse = conditionalFalse;␊
      exports.conditionalTrue = conditionalTrue;␊
      exports["default"] = main;␊
      exports.logicalAnd1 = logicalAnd1;␊
      exports.logicalAnd2 = logicalAnd2;␊
      exports.logicalOr1 = logicalOr1;␊
      exports.logicalOr2 = logicalOr2;␊
      `,
    }

## strict-requires-auto

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var aImportsB = {};␊
      ␊
      var bImportsC = {};␊
      ␊
      var cImportsA = {};␊
      ␊
      var hasRequiredCImportsA;␊
      ␊
      function requireCImportsA () {␊
      	if (hasRequiredCImportsA) return cImportsA;␊
      	hasRequiredCImportsA = 1;␊
      	cImportsA.a = requireAImportsB().a;␊
      	return cImportsA;␊
      }␊
      ␊
      var hasRequiredBImportsC;␊
      ␊
      function requireBImportsC () {␊
      	if (hasRequiredBImportsC) return bImportsC;␊
      	hasRequiredBImportsC = 1;␊
      	bImportsC.a = requireCImportsA().a;␊
      	return bImportsC;␊
      }␊
      ␊
      var hasRequiredAImportsB;␊
      ␊
      function requireAImportsB () {␊
      	if (hasRequiredAImportsB) return aImportsB;␊
      	hasRequiredAImportsB = 1;␊
      	aImportsB.a = 'a';␊
      	t.is(requireBImportsC().a, 'a');␊
      	return aImportsB;␊
      }␊
      ␊
      requireAImportsB();␊
      ␊
      module.exports = main;␊
      `,
    }

## strict-requires-circular

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var other = {};␊
      ␊
      var hasRequiredOther;␊
      ␊
      function requireOther () {␊
      	if (hasRequiredOther) return other;␊
      	hasRequiredOther = 1;␊
      	other.foo = requireMain().foo;␊
      	return other;␊
      }␊
      ␊
      var hasRequiredMain;␊
      ␊
      function requireMain () {␊
      	if (hasRequiredMain) return main;␊
      	hasRequiredMain = 1;␊
      	main.foo = 'foo';␊
      	t.is(requireOther().foo, 'foo');␊
      	return main;␊
      }␊
      ␊
      var mainExports = requireMain();␊
      ␊
      module.exports = mainExports;␊
      `,
    }

## strict-requires-cycle-detection

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var aImportsB = {};␊
      ␊
      var bImportsC = {};␊
      ␊
      var cImportsA = {};␊
      ␊
      var hasRequiredCImportsA;␊
      ␊
      function requireCImportsA () {␊
      	if (hasRequiredCImportsA) return cImportsA;␊
      	hasRequiredCImportsA = 1;␊
      	cImportsA.a = requireAImportsB().a;␊
      	return cImportsA;␊
      }␊
      ␊
      var hasRequiredBImportsC;␊
      ␊
      function requireBImportsC () {␊
      	if (hasRequiredBImportsC) return bImportsC;␊
      	hasRequiredBImportsC = 1;␊
      	bImportsC.a = requireCImportsA().a;␊
      	return bImportsC;␊
      }␊
      ␊
      var hasRequiredAImportsB;␊
      ␊
      function requireAImportsB () {␊
      	if (hasRequiredAImportsB) return aImportsB;␊
      	hasRequiredAImportsB = 1;␊
      	aImportsB.a = 'a';␊
      	t.is(requireBImportsC().a, 'a');␊
      	return aImportsB;␊
      }␊
      ␊
      requireAImportsB();␊
      ␊
      module.exports = main;␊
      `,
    }

## strict-requires-debug

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var aImportsB = {};␊
      ␊
      var bImportsC = {};␊
      ␊
      var cImportsA = {};␊
      ␊
      var hasRequiredCImportsA;␊
      ␊
      function requireCImportsA () {␊
      	if (hasRequiredCImportsA) return cImportsA;␊
      	hasRequiredCImportsA = 1;␊
      	cImportsA.a = requireAImportsB().a;␊
      	return cImportsA;␊
      }␊
      ␊
      var hasRequiredBImportsC;␊
      ␊
      function requireBImportsC () {␊
      	if (hasRequiredBImportsC) return bImportsC;␊
      	hasRequiredBImportsC = 1;␊
      	bImportsC.a = requireCImportsA().a;␊
      	return bImportsC;␊
      }␊
      ␊
      var hasRequiredAImportsB;␊
      ␊
      function requireAImportsB () {␊
      	if (hasRequiredAImportsB) return aImportsB;␊
      	hasRequiredAImportsB = 1;␊
      	aImportsB.a = 'a';␊
      	t.is(requireBImportsC().a, 'a');␊
      	return aImportsB;␊
      }␊
      ␊
      requireAImportsB();␊
      ␊
      module.exports = main;␊
      `,
    }

## strict-requires-debug-none

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = 'bar';␊
      ␊
      module.exports = main;␊
      `,
    }

## strict-requires-detect-conditionals

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      var main = {};␊
      ␊
      var throws = {};␊
      ␊
      var hasRequiredThrows;␊
      ␊
      function requireThrows () {␊
      	if (hasRequiredThrows) return throws;␊
      	hasRequiredThrows = 1;␊
      	throw new Error('This should never be executed or imported');␊
      }␊
      ␊
      var hoisted = 'this should be top-level';␊
      ␊
      /* eslint-disable global-require */␊
      ␊
      commonjsGlobal.false = false;␊
      commonjsGlobal.true = true;␊
      ␊
      if (commonjsGlobal.false) {␊
        requireThrows();␊
      }␊
      ␊
      if (commonjsGlobal.true) ; else {␊
        requireThrows();␊
      }␊
      ␊
      commonjsGlobal.false ? requireThrows() : null;␊
      commonjsGlobal.true ? null : requireThrows();␊
      ␊
      commonjsGlobal.false && requireThrows();␊
      commonjsGlobal.true || requireThrows();␊
      ␊
      function requireFunctionDeclaration() {␊
        requireThrows();␊
      }␊
      ␊
      const requireFunctionExpression = function () {␊
        requireThrows();␊
      };␊
      ␊
      const requireArrowFunction = () => requireThrows();␊
      ␊
      if (commonjsGlobal.false) {␊
        requireFunctionDeclaration();␊
        requireFunctionExpression();␊
        requireArrowFunction();␊
      }␊
      ␊
      // These should not cause wrapping␊
      t.is(␊
        (function () {␊
          return hoisted;␊
        })(),␊
        'this should be top-level'␊
      );␊
      t.is((() => hoisted)(), 'this should be top-level');␊
      ␊
      module.exports = main;␊
      `,
    }

## strict-requires-entry-node-resolve

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var hasRequiredMain;␊
      ␊
      function requireMain () {␊
      	if (hasRequiredMain) return main;␊
      	hasRequiredMain = 1;␊
      	main.foo = 'foo';␊
      	return main;␊
      }␊
      ␊
      var mainExports = requireMain();␊
      ␊
      module.exports = mainExports;␊
      `,
    }

## strict-requires-exportmode-exports

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      var main = {};␊
      ␊
      var assignExports = {};␊
      ␊
      var hasRequiredAssignExports;␊
      ␊
      function requireAssignExports () {␊
      	if (hasRequiredAssignExports) return assignExports;␊
      	hasRequiredAssignExports = 1;␊
      	assignExports.foo = 'foo';␊
      	assignExports.bar = 'bar';␊
      	commonjsGlobal.hasAssignExportsRun = true;␊
      	return assignExports;␊
      }␊
      ␊
      var compiledEsm = {};␊
      ␊
      var hasRequiredCompiledEsm;␊
      ␊
      function requireCompiledEsm () {␊
      	if (hasRequiredCompiledEsm) return compiledEsm;␊
      	hasRequiredCompiledEsm = 1;␊
      	compiledEsm.__esModule = true;␊
      	Object.defineProperty(compiledEsm, '__esModule', { value: true });␊
      	compiledEsm.foo = 'foo';␊
      	commonjsGlobal.hasCompiledEsmRun = true;␊
      	return compiledEsm;␊
      }␊
      ␊
      var wrappedExports = {};␊
      ␊
      var hasRequiredWrappedExports;␊
      ␊
      function requireWrappedExports () {␊
      	if (hasRequiredWrappedExports) return wrappedExports;␊
      	hasRequiredWrappedExports = 1;␊
      	(function (exports) {␊
      		exports.foo = 'foo';␊
      		exports = {};␊
      		exports.bar = 'bar';␊
      		commonjsGlobal.hasWrappedExportsRun = true;␊
      } (wrappedExports));␊
      	return wrappedExports;␊
      }␊
      ␊
      t.is(commonjsGlobal.hasAssignExportsRun, undefined, 'before require');␊
      t.deepEqual(requireAssignExports(), { foo: 'foo', bar: 'bar' });␊
      ␊
      t.is(commonjsGlobal.hasAssignExportsRun, true, 'after require');␊
      delete commonjsGlobal.hasAssignExportsRun;␊
      ␊
      t.is(commonjsGlobal.hasCompiledEsmRun, undefined, 'before require');␊
      t.deepEqual(requireCompiledEsm(), { foo: 'foo', __esModule: true });␊
      ␊
      t.is(commonjsGlobal.hasCompiledEsmRun, true, 'after require');␊
      delete commonjsGlobal.hasCompiledEsmRun;␊
      ␊
      t.is(commonjsGlobal.hasWrappedExportsRun, undefined, 'before require');␊
      t.deepEqual(requireWrappedExports(), { foo: 'foo' });␊
      ␊
      t.is(commonjsGlobal.hasWrappedExportsRun, true, 'after require');␊
      delete commonjsGlobal.hasWrappedExportsRun;␊
      ␊
      module.exports = main;␊
      `,
    }

## strict-requires-exportmode-module

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      var main = {};␊
      ␊
      var assignModuleExports = {exports: {}};␊
      ␊
      var hasRequiredAssignModuleExports;␊
      ␊
      function requireAssignModuleExports () {␊
      	if (hasRequiredAssignModuleExports) return assignModuleExports.exports;␊
      	hasRequiredAssignModuleExports = 1;␊
      	if (Math.random() > 0.5) {␊
      	  assignModuleExports.exports = { foo: 'foo' };␊
      	} else {␊
      	  assignModuleExports.exports = { foo: 'foo' };␊
      	}␊
      	commonjsGlobal.hasAssignModuleExportsRun = true;␊
      	return assignModuleExports.exports;␊
      }␊
      ␊
      var assignModuleAndExports = {exports: {}};␊
      ␊
      var hasRequiredAssignModuleAndExports;␊
      ␊
      function requireAssignModuleAndExports () {␊
      	if (hasRequiredAssignModuleAndExports) return assignModuleAndExports.exports;␊
      	hasRequiredAssignModuleAndExports = 1;␊
      	assignModuleAndExports.exports = { foo: 'foo' };␊
      	assignModuleAndExports.exports.bar = 'bar';␊
      	commonjsGlobal.hasAssignModuleAndExportsRun = true;␊
      	return assignModuleAndExports.exports;␊
      }␊
      ␊
      var wrappedModuleExports = {exports: {}};␊
      ␊
      var hasRequiredWrappedModuleExports;␊
      ␊
      function requireWrappedModuleExports () {␊
      	if (hasRequiredWrappedModuleExports) return wrappedModuleExports.exports;␊
      	hasRequiredWrappedModuleExports = 1;␊
      	(function (module, exports) {␊
      		module.exports = { foo: 'foo' };␊
      		commonjsGlobal.hasWrappedModuleExportsRun = true;␊
      } (wrappedModuleExports));␊
      	return wrappedModuleExports.exports;␊
      }␊
      ␊
      t.is(commonjsGlobal.hasAssignModuleExportsRun, undefined, 'before require');␊
      t.is(requireAssignModuleExports().foo, 'foo');␊
      ␊
      t.is(commonjsGlobal.hasAssignModuleExportsRun, true, 'after require');␊
      delete commonjsGlobal.hasAssignModuleExportsRun;␊
      ␊
      t.is(commonjsGlobal.hasAssignModuleAndExportsRun, undefined, 'before require');␊
      t.is(requireAssignModuleAndExports().foo, 'foo');␊
      ␊
      t.is(commonjsGlobal.hasAssignModuleAndExportsRun, true, 'after require');␊
      delete commonjsGlobal.hasAssignModuleAndExportsRun;␊
      ␊
      t.is(commonjsGlobal.hasWrappedModuleExportsRun, undefined, 'before require');␊
      t.is(requireWrappedModuleExports().foo, 'foo');␊
      ␊
      t.is(commonjsGlobal.hasWrappedModuleExportsRun, true, 'after require');␊
      delete commonjsGlobal.hasWrappedModuleExportsRun;␊
      ␊
      module.exports = main;␊
      `,
    }

## strict-requires-exportmode-replace

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      var main = {};␊
      ␊
      var replaceModuleExports;␊
      var hasRequiredReplaceModuleExports;␊
      ␊
      function requireReplaceModuleExports () {␊
      	if (hasRequiredReplaceModuleExports) return replaceModuleExports;␊
      	hasRequiredReplaceModuleExports = 1;␊
      	replaceModuleExports = { foo: 'foo' };␊
      	commonjsGlobal.hasReplaceModuleExportsRun = true;␊
      	return replaceModuleExports;␊
      }␊
      ␊
      t.is(commonjsGlobal.hasReplaceModuleExportsRun, undefined, 'before require');␊
      t.is(requireReplaceModuleExports().foo, 'foo');␊
      ␊
      t.is(commonjsGlobal.hasReplaceModuleExportsRun, true, 'after require');␊
      delete commonjsGlobal.hasReplaceModuleExportsRun;␊
      ␊
      module.exports = main;␊
      `,
    }

## strict-requires-external

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$$0 = require('external');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);␊
      ␊
      var main = {};␊
      ␊
      var hasRequiredMain;␊
      ␊
      function requireMain () {␊
      	if (hasRequiredMain) return main;␊
      	hasRequiredMain = 1;␊
      	t.is(require$$0__default["default"].message, 'it works');␊
      	return main;␊
      }␊
      ␊
      var mainExports = requireMain();␊
      ␊
      module.exports = mainExports;␊
      `,
    }

## strict-requires-file-without-module-type

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      var main = {};␊
      ␊
      var error = {};␊
      ␊
      var hasRequiredError;␊
      ␊
      function requireError () {␊
      	if (hasRequiredError) return error;␊
      	hasRequiredError = 1;␊
      	throw new Error('FAIL');␊
      }␊
      ␊
      var hasRequiredMain;␊
      ␊
      function requireMain () {␊
      	if (hasRequiredMain) return main;␊
      	hasRequiredMain = 1;␊
      	commonjsGlobal.null = 0;␊
      ␊
      	// eslint-disable-next-line global-require␊
      	t.is(commonjsGlobal.null && requireError(), 0);␊
      	return main;␊
      }␊
      ␊
      var mainExports = requireMain();␊
      ␊
      module.exports = mainExports;␊
      `,
    }

## strict-requires-from-esm

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var strict = {};␊
      ␊
      var hasRequiredStrict;␊
      ␊
      function requireStrict () {␊
      	if (hasRequiredStrict) return strict;␊
      	hasRequiredStrict = 1;␊
      	strict.foo = 'foo';␊
      	return strict;␊
      }␊
      ␊
      var strictExports = requireStrict();␊
      ␊
      t.is(requireStrict().foo, 'foo');␊
      ␊
      t.is(strictExports.foo, 'foo');␊
      `,
    }

## strict-requires-mixed-esm

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$1 = {};␊
      ␊
      var hasRequiredRequire;␊
      ␊
      function requireRequire () {␊
      	if (hasRequiredRequire) return require$1;␊
      	hasRequiredRequire = 1;␊
      	require$1.foo = 'foo';␊
      	return require$1;␊
      }␊
      ␊
      var _import = {};␊
      ␊
      var hasRequired_import;␊
      ␊
      function require_import () {␊
      	if (hasRequired_import) return _import;␊
      	hasRequired_import = 1;␊
      	_import.foo = 'foo';␊
      	return _import;␊
      }␊
      ␊
      var _importExports = require_import();␊
      ␊
      const cjs = requireRequire();␊
      ␊
      t.is(_importExports.foo, 'foo');␊
      t.is(cjs.foo, 'foo');␊
      `,
    }

## strict-requires-multiple-entry

> Snapshot 1

    {
      'generated-main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var hasRequiredMain;␊
      ␊
      function requireMain () {␊
      	if (hasRequiredMain) return main;␊
      	hasRequiredMain = 1;␊
      	main.foo = 'foo';␊
      	return main;␊
      }␊
      ␊
      exports.requireMain = requireMain;␊
      `,
      'main.js': `'use strict';␊
      ␊
      var main = require('./generated-main.js');␊
      ␊
      var mainExports = main.requireMain();␊
      ␊
      module.exports = mainExports;␊
      `,
      'other.js': `'use strict';␊
      ␊
      var main = require('./generated-main.js');␊
      ␊
      var other = {};␊
      ␊
      t.is(main.requireMain().foo, 'foo');␊
      ␊
      module.exports = other;␊
      `,
    }

## this

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      var main = {};␊
      ␊
      var foo$1 = function augmentThis() {␊
        this.x = 'x';␊
      };␊
      ␊
      commonjsGlobal.y = 'y';␊
      ␊
      const foo = foo$1;␊
      ␊
      const obj = {};␊
      foo.call(obj);␊
      ␊
      t.is(obj.x, 'x');␊
      t.is(commonjsGlobal.y, 'y');␊
      ␊
      module.exports = main;␊
      `,
    }

## top-level-and-nested-module-exports-reassignment

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep1$1 = 'original';␊
      if (reassignFirstModuleExports) {␊
        dep1$1 = 'reassigned';␊
      }␊
      ␊
      var dep2$1 = 'original';␊
      if (reassignSecondModuleExports) {␊
        dep2$1 = 'reassigned';␊
      }␊
      ␊
      if (reassignFirstModuleExports) {␊
        dep3$1 = 'reassigned';␊
      }␊
      var dep3$1 = 'final';␊
      ␊
      if (reassignSecondModuleExports) {␊
        dep4$1 = 'reassigned';␊
      }␊
      var dep4$1 = 'final';␊
      ␊
      const dep1 = dep1$1;␊
      const dep2 = dep2$1;␊
      const dep3 = dep3$1;␊
      const dep4 = dep4$1;␊
      ␊
      t.is(dep1, 'reassigned');␊
      t.is(dep2, 'original');␊
      t.is(dep3, 'final');␊
      t.is(dep4, 'final');␊
      ␊
      module.exports = main;␊
      `,
    }

## toplevel-return

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      /* eslint-disable */␊
      ␊
      var main = 'foo';␊
      ␊
      module.exports = main;␊
      `,
    }

## toplevel-return-complex

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var foo$1 = {exports: {}};␊
      ␊
      (function (module) {␊
      ␊
      	module.exports = 'bar';␊
      	{␊
      	  return;␊
      	}␊
      } (foo$1));␊
      ␊
      const foo = foo$1.exports;␊
      ␊
      var main = foo;␊
      ␊
      module.exports = main;␊
      `,
    }

## trailing-slash

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var foo$1 = 42;␊
      ␊
      const foo = foo$1;␊
      ␊
      t.is(foo, 42);␊
      ␊
      module.exports = main;␊
      `,
    }

## transform-mixed-modules

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getAugmentedNamespace(n) {␊
        var f = n.default;␊
      	if (typeof f == "function") {␊
      		var a = function () {␊
      			return f.apply(this, arguments);␊
      		};␊
      		a.prototype = f.prototype;␊
        } else a = {};␊
        Object.defineProperty(a, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var other$1 = 'other';␊
      ␊
      const other = other$1;␊
      ␊
      var dep$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	other: other␊
      });␊
      ␊
      var require$$0 = /*@__PURE__*/getAugmentedNamespace(dep$1);␊
      ␊
      const dep = require$$0;␊
      ␊
      t.is(other, 'other');␊
      t.deepEqual(dep, { other: 'other' });␊
      `,
    }

## transpiled-esm-default

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var external = require('external-esm-default');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      var external__default = /*#__PURE__*/_interopDefaultLegacy(external);␊
      ␊
      var dep = {};␊
      ␊
      Object.defineProperty(dep, '__esModule', { value: true });␊
      var _default = dep.default = 'default';␊
      ␊
      t.is(_default, 'default');␊
      t.is(external__default["default"], 'bar');␊
      `,
    }

## transpiled-esm-entry-default

> Snapshot 1

    {
      'entry-942c2db3.js': `'use strict';␊
      ␊
      function _mergeNamespaces(n, m) {␊
      	m.forEach(function (e) {␊
      		e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default' && !(k in n)) {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () { return e[k]; }␊
      				});␊
      			}␊
      		});␊
      	});␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var entry$1 = {};␊
      ␊
      Object.defineProperty(entry$1, '__esModule', { value: true });␊
      var _default = entry$1.default = 'default';␊
      ␊
      var entry = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({␊
      	__proto__: null,␊
      	'default': _default␊
      }, [entry$1]));␊
      ␊
      exports._default = _default;␊
      exports.entry = entry;␊
      `,
      'entry.js': `'use strict';␊
      ␊
      var entry = require('./entry-942c2db3.js');␊
      ␊
      ␊
      ␊
      module.exports = entry._default;␊
      `,
      'main.js': `'use strict';␊
      ␊
      var entry = require('./entry-942c2db3.js');␊
      ␊
      t.deepEqual(entry.entry, { default: 'default' });␊
      `,
    }

## transpiled-esm-entry-mixed

> Snapshot 1

    {
      'entry-51172103.js': `'use strict';␊
      ␊
      function _mergeNamespaces(n, m) {␊
      	m.forEach(function (e) {␊
      		e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default' && !(k in n)) {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () { return e[k]; }␊
      				});␊
      			}␊
      		});␊
      	});␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var entry$1 = {};␊
      ␊
      Object.defineProperty(entry$1, '__esModule', { value: true });␊
      var _default = entry$1.default = 'default';␊
      var named = entry$1.named = 'named';␊
      ␊
      var entry = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({␊
      	__proto__: null,␊
      	named: named,␊
      	'default': _default␊
      }, [entry$1]));␊
      ␊
      exports._default = _default;␊
      exports.entry = entry;␊
      exports.named = named;␊
      `,
      'entry.js': `'use strict';␊
      ␊
      Object.defineProperty(exports, '__esModule', { value: true });␊
      ␊
      var entry = require('./entry-51172103.js');␊
      ␊
      ␊
      ␊
      exports["default"] = entry._default;␊
      exports.named = entry.named;␊
      `,
      'main.js': `'use strict';␊
      ␊
      var entry = require('./entry-51172103.js');␊
      ␊
      t.deepEqual(entry.entry, { default: 'default', named: 'named' });␊
      `,
    }

## transpiled-esm-entry-named

> Snapshot 1

    {
      'entry.js': `'use strict';␊
      ␊
      Object.defineProperty(exports, '__esModule', { value: true });␊
      ␊
      var entry = require('./generated-entry.js');␊
      ␊
      ␊
      ␊
      exports["default"] = entry.entry$1;␊
      exports.named = entry.named;␊
      `,
      'generated-entry.js': `'use strict';␊
      ␊
      function _mergeNamespaces(n, m) {␊
      	m.forEach(function (e) {␊
      		e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default' && !(k in n)) {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () { return e[k]; }␊
      				});␊
      			}␊
      		});␊
      	});␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var entry$1 = {};␊
      ␊
      Object.defineProperty(entry$1, '__esModule', { value: true });␊
      var named = entry$1.named = 'named';␊
      ␊
      var entry = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({␊
      	__proto__: null,␊
      	named: named,␊
      	'default': entry$1␊
      }, [entry$1]));␊
      ␊
      exports.entry = entry;␊
      exports.entry$1 = entry$1;␊
      exports.named = named;␊
      `,
      'main.js': `'use strict';␊
      ␊
      var entry = require('./generated-entry.js');␊
      ␊
      t.deepEqual(entry.entry, {␊
        default: {␊
          named: 'named'␊
        },␊
        named: 'named'␊
      });␊
      `,
    }

## transpiled-esm-mixed

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var external = require('external-esm-mixed');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      var external__default = /*#__PURE__*/_interopDefaultLegacy(external);␊
      ␊
      var dep = {};␊
      ␊
      Object.defineProperty(dep, '__esModule', { value: true });␊
      var named = dep.named = 'named';␊
      var _default = dep.default = 'default';␊
      ␊
      t.is(_default, 'default');␊
      t.is(named, 'named');␊
      t.is(external__default["default"], 'bar');␊
      t.is(external.foo, 'foo');␊
      `,
    }

## transpiled-esm-named

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var externalEsmNamed = require('external-esm-named');␊
      ␊
      var dep = {};␊
      ␊
      Object.defineProperty(dep, '__esModule', { value: true });␊
      var named = dep.named = 'named';␊
      ␊
      t.is(named, 'named');␊
      t.is(externalEsmNamed.foo, 'foo');␊
      `,
    }

## transpiled-esm-namespace-default

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var external = require('external-esm-default');␊
      ␊
      function _interopNamespace(e) {␊
        if (e && e.__esModule) return e;␊
        var n = Object.create(null);␊
        if (e) {␊
          Object.keys(e).forEach(function (k) {␊
            if (k !== 'default') {␊
              var d = Object.getOwnPropertyDescriptor(e, k);␊
              Object.defineProperty(n, k, d.get ? d : {␊
                enumerable: true,␊
                get: function () { return e[k]; }␊
              });␊
            }␊
          });␊
        }␊
        n["default"] = e;␊
        return Object.freeze(n);␊
      }␊
      ␊
      function _mergeNamespaces(n, m) {␊
        m.forEach(function (e) {␊
          e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {␊
            if (k !== 'default' && !(k in n)) {␊
              var d = Object.getOwnPropertyDescriptor(e, k);␊
              Object.defineProperty(n, k, d.get ? d : {␊
                enumerable: true,␊
                get: function () { return e[k]; }␊
              });␊
            }␊
          });␊
        });␊
        return Object.freeze(n);␊
      }␊
      ␊
      var external__namespace = /*#__PURE__*/_interopNamespace(external);␊
      ␊
      var dep$1 = {};␊
      ␊
      Object.defineProperty(dep$1, '__esModule', { value: true });␊
      var _default = dep$1.default = 'default';␊
      ␊
      var dep = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({␊
        __proto__: null,␊
        'default': _default␊
      }, [dep$1]));␊
      ␊
      t.deepEqual(dep, {␊
        default: 'default'␊
      });␊
      ␊
      t.deepEqual(external__namespace, {␊
        default: 'bar'␊
      });␊
      `,
    }

## transpiled-esm-namespace-mixed

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var external = require('external-esm-mixed');␊
      ␊
      function _interopNamespace(e) {␊
        if (e && e.__esModule) return e;␊
        var n = Object.create(null);␊
        if (e) {␊
          Object.keys(e).forEach(function (k) {␊
            if (k !== 'default') {␊
              var d = Object.getOwnPropertyDescriptor(e, k);␊
              Object.defineProperty(n, k, d.get ? d : {␊
                enumerable: true,␊
                get: function () { return e[k]; }␊
              });␊
            }␊
          });␊
        }␊
        n["default"] = e;␊
        return Object.freeze(n);␊
      }␊
      ␊
      function _mergeNamespaces(n, m) {␊
        m.forEach(function (e) {␊
          e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {␊
            if (k !== 'default' && !(k in n)) {␊
              var d = Object.getOwnPropertyDescriptor(e, k);␊
              Object.defineProperty(n, k, d.get ? d : {␊
                enumerable: true,␊
                get: function () { return e[k]; }␊
              });␊
            }␊
          });␊
        });␊
        return Object.freeze(n);␊
      }␊
      ␊
      var external__namespace = /*#__PURE__*/_interopNamespace(external);␊
      ␊
      var dep$1 = {};␊
      ␊
      Object.defineProperty(dep$1, '__esModule', { value: true });␊
      var named = dep$1.named = 'named';␊
      var _default = dep$1.default = 'default';␊
      ␊
      var dep = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({␊
        __proto__: null,␊
        named: named,␊
        'default': _default␊
      }, [dep$1]));␊
      ␊
      t.deepEqual(dep, {␊
        default: 'default',␊
        named: 'named'␊
      });␊
      ␊
      t.deepEqual(external__namespace, {␊
        default: 'bar',␊
        foo: 'foo'␊
      });␊
      `,
    }

## transpiled-esm-namespace-named

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var external = require('external-esm-named');␊
      ␊
      function _interopNamespace(e) {␊
        if (e && e.__esModule) return e;␊
        var n = Object.create(null);␊
        if (e) {␊
          Object.keys(e).forEach(function (k) {␊
            if (k !== 'default') {␊
              var d = Object.getOwnPropertyDescriptor(e, k);␊
              Object.defineProperty(n, k, d.get ? d : {␊
                enumerable: true,␊
                get: function () { return e[k]; }␊
              });␊
            }␊
          });␊
        }␊
        n["default"] = e;␊
        return Object.freeze(n);␊
      }␊
      ␊
      function _mergeNamespaces(n, m) {␊
        m.forEach(function (e) {␊
          e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {␊
            if (k !== 'default' && !(k in n)) {␊
              var d = Object.getOwnPropertyDescriptor(e, k);␊
              Object.defineProperty(n, k, d.get ? d : {␊
                enumerable: true,␊
                get: function () { return e[k]; }␊
              });␊
            }␊
          });␊
        });␊
        return Object.freeze(n);␊
      }␊
      ␊
      var external__namespace = /*#__PURE__*/_interopNamespace(external);␊
      ␊
      var dep$1 = {};␊
      ␊
      Object.defineProperty(dep$1, '__esModule', { value: true });␊
      var named = dep$1.named = 'named';␊
      ␊
      var dep = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({␊
        __proto__: null,␊
        named: named,␊
        'default': dep$1␊
      }, [dep$1]));␊
      ␊
      t.deepEqual(dep, {␊
        default: {␊
          named: 'named'␊
        },␊
        named: 'named'␊
      });␊
      ␊
      t.deepEqual(external__namespace, {␊
        foo: 'foo'␊
      });␊
      `,
    }

## transpiled-esm-nested-module-exports

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getDefaultExportFromCjs (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      var dep$1 = {exports: {}};␊
      ␊
      Object.defineProperty(dep$1.exports, '__esModule', { value: true });␊
      ␊
      if (globalValue) {␊
        dep$1.exports = 'first';␊
      } else {␊
        dep$1.exports = 'second';␊
      }␊
      ␊
      var dep = /*@__PURE__*/getDefaultExportFromCjs(dep$1.exports);␊
      ␊
      t.is(dep, 'first');␊
      `,
    }

## transpiled-esm-nested-module-exports2

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getDefaultExportFromCjs (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      var dep$1 = {exports: {}};␊
      ␊
      if (globalValue) {␊
        dep$1.exports = { default: 'first' };␊
      } else {␊
        dep$1.exports = { default: 'second' };␊
      }␊
      ␊
      Object.defineProperty(dep$1.exports, '__esModule', { value: true });␊
      ␊
      var dep = /*@__PURE__*/getDefaultExportFromCjs(dep$1.exports);␊
      ␊
      t.is(dep, 'first');␊
      `,
    }

## transpiled-esm-reexported-default

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getDefaultExportFromCjs (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      var proxy = {exports: {}};␊
      ␊
      var dep$1 = {};␊
      ␊
      Object.defineProperty(dep$1, '__esModule', { value: true });␊
      dep$1.default = 'default';␊
      ␊
      (function (module) {␊
      	module.exports = dep$1;␊
      } (proxy));␊
      ␊
      var dep = /*@__PURE__*/getDefaultExportFromCjs(proxy.exports);␊
      ␊
      t.is(dep, 'default');␊
      `,
    }

## transpiled-esm-reexported-entry-default

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function _mergeNamespaces(n, m) {␊
      	m.forEach(function (e) {␊
      		e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default' && !(k in n)) {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () { return e[k]; }␊
      				});␊
      			}␊
      		});␊
      	});␊
      	return Object.freeze(n);␊
      }␊
      ␊
      function getDefaultExportFromCjs (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      var proxy$1 = {exports: {}};␊
      ␊
      var entry$1 = {};␊
      ␊
      Object.defineProperty(entry$1, '__esModule', { value: true });␊
      entry$1.default = 'default';␊
      ␊
      (function (module) {␊
      	module.exports = entry$1;␊
      } (proxy$1));␊
      ␊
      var proxy = /*@__PURE__*/getDefaultExportFromCjs(proxy$1.exports);␊
      ␊
      var entry = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({␊
      	__proto__: null,␊
      	'default': proxy␊
      }, [proxy$1.exports]));␊
      ␊
      t.deepEqual(entry, { default: 'default' });␊
      `,
    }

## transpiled-esm-reexported-entry-mixed

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function _mergeNamespaces(n, m) {␊
      	m.forEach(function (e) {␊
      		e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default' && !(k in n)) {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () { return e[k]; }␊
      				});␊
      			}␊
      		});␊
      	});␊
      	return Object.freeze(n);␊
      }␊
      ␊
      function getDefaultExportFromCjs (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      var proxy$1 = {exports: {}};␊
      ␊
      var entry$1 = {};␊
      ␊
      Object.defineProperty(entry$1, '__esModule', { value: true });␊
      entry$1.default = 'default';␊
      entry$1.named = 'named';␊
      ␊
      (function (module) {␊
      	module.exports = entry$1;␊
      } (proxy$1));␊
      ␊
      var proxy = /*@__PURE__*/getDefaultExportFromCjs(proxy$1.exports);␊
      ␊
      var entry = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({␊
      	__proto__: null,␊
      	'default': proxy␊
      }, [proxy$1.exports]));␊
      ␊
      t.deepEqual(entry, { default: 'default', named: 'named' });␊
      `,
    }

## transpiled-esm-reexported-entry-named

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function _mergeNamespaces(n, m) {␊
      	m.forEach(function (e) {␊
      		e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default' && !(k in n)) {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () { return e[k]; }␊
      				});␊
      			}␊
      		});␊
      	});␊
      	return Object.freeze(n);␊
      }␊
      ␊
      function getDefaultExportFromCjs (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      var proxy$1 = {exports: {}};␊
      ␊
      var entry$1 = {};␊
      ␊
      Object.defineProperty(entry$1, '__esModule', { value: true });␊
      entry$1.named = 'named';␊
      ␊
      (function (module) {␊
      	module.exports = entry$1;␊
      } (proxy$1));␊
      ␊
      var proxy = /*@__PURE__*/getDefaultExportFromCjs(proxy$1.exports);␊
      ␊
      var entry = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({␊
      	__proto__: null,␊
      	'default': proxy␊
      }, [proxy$1.exports]));␊
      ␊
      t.deepEqual(entry, {␊
        default: {␊
          named: 'named',␊
        },␊
        named: 'named'␊
      });␊
      `,
    }

## transpiled-esm-reexported-mixed

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getDefaultExportFromCjs (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      var proxy = {exports: {}};␊
      ␊
      var dep$1 = {};␊
      ␊
      Object.defineProperty(dep$1, '__esModule', { value: true });␊
      dep$1.named = 'named';␊
      dep$1.default = 'default';␊
      ␊
      (function (module) {␊
      	module.exports = dep$1;␊
      } (proxy));␊
      ␊
      var dep = /*@__PURE__*/getDefaultExportFromCjs(proxy.exports);␊
      ␊
      t.is(dep, 'default');␊
      t.is(proxy.exports.named, 'named');␊
      `,
    }

## transpiled-esm-reexported-named

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var proxy = {exports: {}};␊
      ␊
      var dep = {};␊
      ␊
      Object.defineProperty(dep, '__esModule', { value: true });␊
      dep.named = 'named';␊
      ␊
      (function (module) {␊
      	module.exports = dep;␊
      } (proxy));␊
      ␊
      t.is(proxy.exports.named, 'named');␊
      `,
    }

## transpiled-esm-required

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep$1 = {};␊
      ␊
      Object.defineProperty(dep$1, '__esModule', { value: true });␊
      dep$1.named = 'named';␊
      dep$1.default = 'default';␊
      ␊
      const dep = dep$1;␊
      ␊
      t.deepEqual(dep, {␊
        default: 'default',␊
        named: 'named'␊
      });␊
      ␊
      // eslint-disable-next-line no-prototype-builtins␊
      t.is(dep.hasOwnProperty('named'), true);␊
      ␊
      module.exports = main;␊
      `,
    }

## transpiled-esm-transpiled-importer

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep$1 = {};␊
      ␊
      Object.defineProperty(dep$1, '__esModule', { value: true });␊
      dep$1.default = 'default';␊
      ␊
      const dep = dep$1;␊
      ␊
      function _interopDefault$1(e) {␊
        return e && e.__esModule ? e : { default: e };␊
      }␊
      ␊
      t.is(dep.__esModule, true);␊
      const dep__default = /* #__PURE__*/ _interopDefault$1(dep);␊
      t.is(dep__default.default, 'default');␊
      ␊
      module.exports = main;␊
      `,
    }

## try-catch

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable global-require */␊
      ␊
      try {␊
        require('uninstalled-external-module');␊
      } catch (ignored) {␊
        /* ignore */␊
      }␊
      ␊
      module.exports = main;␊
      `,
    }

## try-catch-ids-array

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable global-require */␊
      ␊
      try {␊
        require('uninstalled-external-module');␊
      } catch (ignored) {␊
        /* ignore */␊
      }␊
      ␊
      module.exports = main;␊
      `,
    }

## try-catch-ids-function

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable global-require */␊
      ␊
      try {␊
        require('uninstalled-external-module');␊
      } catch (ignored) {␊
        /* ignore */␊
      }␊
      ␊
      module.exports = main;␊
      `,
    }

## try-catch-internal

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep = {};␊
      ␊
      var hasRequiredDep;␊
      ␊
      function requireDep () {␊
      	if (hasRequiredDep) return dep;␊
      	hasRequiredDep = 1;␊
      	dep.foo = 'foo';␊
      	return dep;␊
      }␊
      ␊
      var throws = {};␊
      ␊
      var hasRequiredThrows;␊
      ␊
      function requireThrows () {␊
      	if (hasRequiredThrows) return throws;␊
      	hasRequiredThrows = 1;␊
      	throw new Error('Expected error');␊
      }␊
      ␊
      /* eslint-disable global-require */␊
      ␊
      try {␊
        t.is(requireDep().foo, 'foo');␊
      } catch (err) {␊
        throw new Error(`Could not require: ${err}`);␊
      }␊
      ␊
      try {␊
        requireThrows();␊
      } catch (err) {␊
        t.is(err.message, 'Expected error');␊
      }␊
      ␊
      module.exports = main;␊
      `,
    }

## try-catch-remove

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      module.exports = main;␊
      `,
    }

## typeof-module-require

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function commonjsRequire(path) {␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      var foo = {exports: {}};␊
      ␊
      if (typeof commonjsRequire === 'function' && commonjsRequire) {␊
        foo.exports = 'require detected';␊
      } else {␊
        foo.exports = 'could not detect require';␊
      }␊
      ␊
      t.is(foo.exports, 'require detected');␊
      `,
    }

## typeof-require

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function commonjsRequire(path) {␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      var foo = {exports: {}};␊
      ␊
      if (typeof commonjsRequire === 'function' && commonjsRequire) {␊
        foo.exports = 1;␊
      } else {␊
        foo.exports = 2;␊
      }␊
      ␊
      t.is(foo.exports, 1);␊
      `,
    }

## unresolved-dependencies

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$$0 = require('path');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);␊
      ␊
      var main = {};␊
      ␊
      const path = require$$0__default["default"];␊
      ␊
      t.is(typeof path.resolve, 'function');␊
      ␊
      module.exports = main;␊
      `,
    }

## warn-this-resolve-without-options

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var foo$1 = 21;␊
      ␊
      const foo = foo$1;␊
      ␊
      var main = foo * 2;␊
      ␊
      module.exports = main;␊
      `,
    }
