message: Add importer tests for resolveToModule
diff: *
  */
  -import { parse, noopImporter } from '../../../tests/utils';
  +import {
  + parse,
  + statement,
  + noopImporter,
  + makeMockImporter,
  +} from '../../../tests/utils';
  import resolveToModule from '../resolveToModule';
  describe('resolveToModule', () => {
  @@ -15,6 +20,18 @@ describe('resolveToModule', () => {
  return root.get('body', root.node.body.length - 1, 'expression');
  }
  + const mockImporter = makeMockImporter({
  + Foo: statement(`
  + export default bar;
  + import bar from 'Bar';
  + `).get('declaration'),
  +
  + Bar: statement(`
  + export default baz;
  + import baz from 'Baz';
  + `).get('declaration'),
  + });
  +
  it('resolves identifiers', () => {
  const path = parsePath(`
  var foo = require("Foo");
  @@ -85,5 +102,13 @@ describe('resolveToModule', () => {
  `);
  expect(resolveToModule(path, noopImporter)).toBe('Foo');
  });
  +
  + it('can resolve imports until one not expanded', () => {
  + const path = parsePath(`
  + import foo from "Foo";
  + foo;
  + `);
  + expect(resolveToModule(path, mockImporter)).toBe('Baz');
  + });
  });
  });
  