# Snapshot report for `test/rollup-plugin-dynamic-import-vars.test.js`

The actual snapshot is saved in `rollup-plugin-dynamic-import-vars.test.js.snap`.

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

## single dir

> Snapshot 1

    `function __variableDynamicImportRuntime0__(path) {␊
      switch (path) {␊
        case './module-dir-a/module-a-1.js': return import('./module-a-1-a1a9dfd0.js');␊
        case './module-dir-a/module-a-2.js': return import('./module-a-2-28fb3b62.js');␊
        default: return new Promise(function(resolve, reject) {␊
          (typeof queueMicrotask === 'function' ? queueMicrotask : setTimeout)(␊
            reject.bind(null, new Error("Unknown variable dynamic import: " + path))␊
          );␊
        })␊
       }␊
     }␊
    ␊
    function importModule(name) {␊
      return __variableDynamicImportRuntime0__(`./module-dir-a/${name}.js`);␊
    }␊
    ␊
    export { importModule };␊
    `

## multiple dirs

> Snapshot 1

    `function __variableDynamicImportRuntime0__(path) {␊
      switch (path) {␊
        case './module-dir-a/module-a-1.js': return import('./module-a-1-a1a9dfd0.js');␊
        case './module-dir-a/module-a-2.js': return import('./module-a-2-28fb3b62.js');␊
        case './module-dir-b/module-b-1.js': return import('./module-b-1-a616b1e9.js');␊
        case './module-dir-b/module-b-2.js': return import('./module-b-2-219276fa.js');␊
        case './sub-dir/fixture-upwards-path.js': return import('./fixture-upwards-path-35191ee0.js');␊
        default: return new Promise(function(resolve, reject) {␊
          (typeof queueMicrotask === 'function' ? queueMicrotask : setTimeout)(␊
            reject.bind(null, new Error("Unknown variable dynamic import: " + path))␊
          );␊
        })␊
       }␊
     }␊
    ␊
    function importModule(dir, name) {␊
      return __variableDynamicImportRuntime0__(`./${dir}/${name}.js`);␊
    }␊
    ␊
    export { importModule };␊
    `

## upwards dir path

> Snapshot 1

    `function __variableDynamicImportRuntime0__(path) {␊
      switch (path) {␊
        case '../module-dir-a/module-a-1.js': return import('./module-a-1-a1a9dfd0.js');␊
        case '../module-dir-a/module-a-2.js': return import('./module-a-2-28fb3b62.js');␊
        default: return new Promise(function(resolve, reject) {␊
          (typeof queueMicrotask === 'function' ? queueMicrotask : setTimeout)(␊
            reject.bind(null, new Error("Unknown variable dynamic import: " + path))␊
          );␊
        })␊
       }␊
     }␊
    ␊
    function importModule(name) {␊
      return __variableDynamicImportRuntime0__(`../module-dir-a/${name}.js`);␊
    }␊
    ␊
    export { importModule };␊
    `

## complex concatenation

> Snapshot 1

    `function __variableDynamicImportRuntime0__(path) {␊
      switch (path) {␊
        case './module-dir-a/module-a-1.js': return import('./module-a-1-a1a9dfd0.js');␊
        case './module-dir-a/module-a-2.js': return import('./module-a-2-28fb3b62.js');␊
        case './module-dir-b/module-b-1.js': return import('./module-b-1-a616b1e9.js');␊
        case './module-dir-b/module-b-2.js': return import('./module-b-2-219276fa.js');␊
        default: return new Promise(function(resolve, reject) {␊
          (typeof queueMicrotask === 'function' ? queueMicrotask : setTimeout)(␊
            reject.bind(null, new Error("Unknown variable dynamic import: " + path))␊
          );␊
        })␊
       }␊
     }␊
    ␊
    function importModule(dirName, name) {␊
      return __variableDynamicImportRuntime0__(`${`./${`module-dir-${dirName}`}` + '/'}${name}.js`);␊
    }␊
    ␊
    export { importModule };␊
    `

## own directory

> Snapshot 1

    `function __variableDynamicImportRuntime0__(path) {␊
      switch (path) {␊
        case './root-module-a.js': return import('./root-module-a-53575bcc.js');␊
        case './root-module-b.js': return import('./root-module-b-55333443.js');␊
        default: return new Promise(function(resolve, reject) {␊
          (typeof queueMicrotask === 'function' ? queueMicrotask : setTimeout)(␊
            reject.bind(null, new Error("Unknown variable dynamic import: " + path))␊
          );␊
        })␊
       }␊
     }␊
    ␊
    function importModule(name) {␊
      return __variableDynamicImportRuntime0__(`./root-module-${name}.js`);␊
    }␊
    ␊
    export { importModule };␊
    `

## multiple dynamic imports

> Snapshot 1

    `function __variableDynamicImportRuntime2__(path) {␊
      switch (path) {␊
        case './module-dir-a/module-a-1.js': return import('./module-a-1-a1a9dfd0.js');␊
        case './module-dir-a/module-a-2.js': return import('./module-a-2-28fb3b62.js');␊
        case './module-dir-b/module-b-1.js': return import('./module-b-1-a616b1e9.js');␊
        case './module-dir-b/module-b-2.js': return import('./module-b-2-219276fa.js');␊
        case './sub-dir/fixture-upwards-path.js': return import('./fixture-upwards-path-35191ee0.js');␊
        default: return new Promise(function(resolve, reject) {␊
          (typeof queueMicrotask === 'function' ? queueMicrotask : setTimeout)(␊
            reject.bind(null, new Error("Unknown variable dynamic import: " + path))␊
          );␊
        })␊
       }␊
     }␊
    ␊
    function __variableDynamicImportRuntime1__(path) {␊
      switch (path) {␊
        case './module-dir-a/module-a-1.js': return import('./module-a-1-a1a9dfd0.js');␊
        case './module-dir-a/module-a-2.js': return import('./module-a-2-28fb3b62.js');␊
        default: return new Promise(function(resolve, reject) {␊
          (typeof queueMicrotask === 'function' ? queueMicrotask : setTimeout)(␊
            reject.bind(null, new Error("Unknown variable dynamic import: " + path))␊
          );␊
        })␊
       }␊
     }␊
    ␊
    function __variableDynamicImportRuntime0__(path) {␊
      switch (path) {␊
        case './module-dir-a/module-a-1.js': return import('./module-a-1-a1a9dfd0.js');␊
        case './module-dir-a/module-a-2.js': return import('./module-a-2-28fb3b62.js');␊
        default: return new Promise(function(resolve, reject) {␊
          (typeof queueMicrotask === 'function' ? queueMicrotask : setTimeout)(␊
            reject.bind(null, new Error("Unknown variable dynamic import: " + path))␊
          );␊
        })␊
       }␊
     }␊
    ␊
    class Foo {␊
      importModule(name) {␊
        return __variableDynamicImportRuntime0__(`./module-dir-a/${name}.js`);␊
      }␊
    }␊
    ␊
    __variableDynamicImportRuntime1__(`./module-dir-a/${name}.js`).then((module) => {␊
      console.log('imported', module);␊
    });␊
    ␊
    function importModuleFromDir(dir, name) {␊
      return __variableDynamicImportRuntime2__(`./${dir}/${name}.js`);␊
    }␊
    ␊
    export { Foo, importModuleFromDir };␊
    `

## doesn't change imports that should not be changed

> Snapshot 1

    `console.log('a-1');␊
    ␊
    function importModuleA() {␊
      return import('./module-a-2-28fb3b62.js');␊
    }␊
    ␊
    function importModuleB() {␊
      return import('./' + 'module-dir-a' + '/' + 'module-a-2' + '.js');␊
    }␊
    ␊
    export { importModuleA, importModuleB };␊
    `

## can exclude files

> Snapshot 1

    `function importModule(name) {␊
      return import(`./module-dir-a/${name}.js`);␊
    }␊
    ␊
    export { importModule };␊
    `
