# 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-fiunS6HF.js');␊
        case './module-dir-a/module-a-2.js': return import('./module-a-2-qepdcyXv.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-fiunS6HF.js');␊
        case './module-dir-a/module-a-2.js': return import('./module-a-2-qepdcyXv.js');␊
        case './module-dir-b/module-b-1.js': return import('./module-b-1-3qdzaV4G.js');␊
        case './module-dir-b/module-b-2.js': return import('./module-b-2-_8gpxG1i.js');␊
        case './sub-dir/fixture-upwards-path.js': return import('./fixture-upwards-path-jrfqlYMu.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-fiunS6HF.js');␊
        case '../module-dir-a/module-a-2.js': return import('./module-a-2-qepdcyXv.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-fiunS6HF.js');␊
        case './module-dir-a/module-a-2.js': return import('./module-a-2-qepdcyXv.js');␊
        case './module-dir-b/module-b-1.js': return import('./module-b-1-3qdzaV4G.js');␊
        case './module-dir-b/module-b-2.js': return import('./module-b-2-_8gpxG1i.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-lF5i40jF.js');␊
        case './root-module-b.js': return import('./root-module-b-F1yin99u.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-fiunS6HF.js');␊
        case './module-dir-a/module-a-2.js': return import('./module-a-2-qepdcyXv.js');␊
        case './module-dir-b/module-b-1.js': return import('./module-b-1-3qdzaV4G.js');␊
        case './module-dir-b/module-b-2.js': return import('./module-b-2-_8gpxG1i.js');␊
        case './sub-dir/fixture-upwards-path.js': return import('./fixture-upwards-path-jrfqlYMu.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-fiunS6HF.js');␊
        case './module-dir-a/module-a-2.js': return import('./module-a-2-qepdcyXv.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-fiunS6HF.js');␊
        case './module-dir-a/module-a-2.js': return import('./module-a-2-qepdcyXv.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-qepdcyXv.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 };␊
    `

## dynamic imports assertions

> Snapshot 1

    `function __variableDynamicImportRuntime0__(path) {␊
      switch (path) {␊
        case './module-dir-a/module-a-1.js': return import('./module-a-1-fiunS6HF.js');␊
        case './module-dir-a/module-a-2.js': return import('./module-a-2-qepdcyXv.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 };␊
    `

## no files in dir

> Snapshot 1

    `function __variableDynamicImportRuntime0__(path) {␊
      switch (path) {␊
    ␊
        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-c/${name}.js\`);␊
    }␊
    ␊
    export { importModule };␊
    `
