testLoadWithFailingModule() {
    const mm = getModuleManager({'a': [], 'b': [], 'c': []});
    mm.setLoader(createUnsuccessfulLoader(mm, 401));
    mm.registerCallback(
        ModuleManager.CallbackType.ERROR, (callbackType, id, cause) => {
          assertEquals(
              'Failure cause was not as expected',
              ModuleLoadFailure.Type.UNAUTHORIZED, cause.type);
          assertEquals('Failure status was not as expected', 401, cause.status);
        });
    let calledBack = false;
    let error = null;

    const d = mm.load('a');
    d.then(
        (ctx) => {
          calledBack = true;
        },
        (err) => {
          error = err;
        });

    assertFalse(calledBack);
    assertNull(error);

    clock.tick(500);

    assertFalse(calledBack);

    // NOTE: Deferred always calls errbacks with an Error object.  The
    // failure type enum is present as error.failureType, while the error
    // message is human readable and contains the module id.
    assertEquals(
        'Failure cause was not as expected',
        ModuleLoadFailure.Type.UNAUTHORIZED, error.failureType.type);
    assertEquals(
        'Failure status was not as expected', 401, error.failureType.status);
    assertEquals(
        'Error message was not as expected',
        'Error loading a: Unauthorized (401)', error.message);
  }
Tests that the deferred's errbacks are called if the module fails to
     load.