Question: I need to test a JavaScript project. There are described several modules but when I try to load them something goes wrong.

```
define([
  'core/BaseModel'
],

function (BaseModel) {
  var MessageModel = BaseModel.extend({
    defaults: {
      messageType: "Advertisment",
      receiver: "me",
      title: "Title",
      heading_1: "Heading1",
      heading_2: "Heading2"
    },

    url: function () {
      var base = this.apipath + '/companies/';
      if (this.isNew()) return base;
      return base + (base.charAt(base.length - 1) == '/' ? '' : '/') + this.id;
    }
  });

  return MessageModel;
});

```

To load the module I do this:

```
var message;
beforeAll(function(done){
    require(['../../../public/js/app/models/Message'], function(Message){
        message = Message;
        done();
    });
});

```

Now message is not undefined but when I test if message.defaults or message.url is defined this fails. what is wrong there?

Answer: 
Given that ***../../../public/js/app/models/Message*** corresponds to the `MessageModel`, what you want to do is:

`var Message = require('../../../public/js/app/models/Message');`

and to create a new instance: `var m = new Message();`

Hope this helps.
I found a solution that works for this exact example. Instead of

```
message = Message;

```

I write

```
message = new Message();

```

But I do exactly the same with a different module and it only gives a timeout error and keeps undefined:

```
var router;

beforeAll(function(done){
    require(['../../../public/js/app/routers/DesktopRouter'], function(Router){
        router = new Router();
        done();
    });
});

```

Its definition is:

```
define(["jquery", "underscore", "backbone", "core/BaseRouter", "models/Session", "i18n!locales",

  "views/NavbarView",
  "views/LoginView",
  'views/SidebarView',
  'views/FooterView',
  'views/VehicleSidebarView',
  "views/DashboardView",
  "views/CompaniesView",
  "views/WorkshopsView",
  "views/VehiclesView",
  "views/UsersView",
  "views/AddVehicleView",
  "views/VehicleTripsView",
  "views/VehicleDataView",
  "views/VehicleServiceView",
  "views/VehicleErrorsView",
  "views/MessageInboxView",
  "views/AddUserView",
  "views/EditUserView",
  "views/EditProfileView",
  "views/AppDownloadView",
  "views/BlockBrowserView"
],

function($, _, Backbone, BaseRouter, Session, i18n,

       NavbarView,
       LoginView,
       SideBarView,
       FooterView,
       VehicleSidebarView,
       DashboardView,
       CompaniesView,
       WorkshopsView,
       VehiclesView,
       UsersView,
       AddVehicleView,
       VehicleTripsView,
       VehicleDataView,
       VehicleServiceView,
       VehicleErrorsView,
       MessageInboxView,
       AddUserView,
       EditUserView,
       EditProfileView,
       AppDownloadView,
       BlockBrowserView
) {

var DesktopRouter = BaseRouter.extend({

  initialize: function () {
.....

```