Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8954353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:18:07+00:00 2026-06-15T14:18:07+00:00

I have a view who extends an external library (let’s call it ExtLib) also

  • 0

I have a view who extends an external library (let’s call it ExtLib) also based on backbone marionette. Basically this lib is a wrapper of common views that share behaviours (e.g. DetailsView, FormView, etc..). So, let’s say I have something like this:

MyApp.module('Views', function(Views, App, Backbone, Marionette, $, _) {

    Views.MyDetailsView = Marionette.ExtLib.DetailsView.extend({
        options: {
            fields: [
                // ...
            ],
            myFunction: function() {
                // ...
            }
        }
    });    
});

In my Jasmine test, I call a controller method that creates an instance of MyDetailsView.

it('does what it should', function() {
    // ...

    controller.showDetails();

    // my expectations
});

Actually, the method in controller just creates the view and render it (into a layout’s region).

showDetails: function(story) {
    var container = new App.Layouts.DetailsLayout();
    var myDetailsView = new App.Views.MyDetailsView({
        model: story
    });

    container.details.show(storyDetailsView);
}

Finally, here’s the error that i get:

TypeError: Cannot read property 'length' of undefined
at eval (eval at <anonymous> (http://localhost:8080/myapp/js/lib/underscore/underscore-min.js?_debugResources=y&n=1354890505115:30:350), <anonymous>:17:35)
at c (http://localhost:8080/myapp/js/lib/underscore/underscore-min.js?_debugResources=y&n=1354890505115:30:430)
at Object.Backbone.Marionette.Renderer.render (http://localhost:8080/myapp/js/backbone-app/conf/renderer.js?_debugResources=y&n=1354890505115:9:17)
at r.ItemView.r.View.extend.render (http://localhost:8080/myapp/js/lib/backbone/backbone.marionette.min.js?_debugResources=y&n=1354890505115:13:4719)
at  Backbone.Marionette.ExtLib.ExtLib.DetailsView.Backbone.Marionette.View.extend.renderFieldView (http://localhost:8080/myapp/js/lib/backbone.marionette.extlib.min.js?_debugResources=y&n=1354890505115:395:14)
// etc...

I think that the problem is that jasmine is not aware of ExtLib. How can I spy on that renderFieldView to avoid the error?

Thanks in advance, as always.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:18:08+00:00Added an answer on June 15, 2026 at 2:18 pm

    I think that the problem is that jasmine is not aware of ExtLib.

    I can’t tell from that stack trace whether your diagnosis is correct; but to verify that, you can view source on the Jasmine runner and see if ExtLib is included in the runner’s page.

    If ExtLib is not included, then the fix depends on how you’re running Jasmine. If you’re using the Jasmine gem and you have a jasmine.yml file, you’ll want to edit jasmine.yml to include ExtLib. If you have a “simple” configuration and you are maintaining Jasmine’s included Javascript files by hand, then you’ll need to add a line to include ExtLib in the runner’s source file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a view who's methods are called by the accelerometer updates in the
i have view controller which contains a button which show the image library ,if
I have a django project that uses views from an external app. The view
I have a controller view who is using thoses 2 functions: [appDelegate getFichesInfo:[[self.fichesCategory idModuleFiche]
Suppose you are making a music library app. You have one view with a
I have a Main View which call a settings panel in another view with
I have super-View who is in charge of rendering sub-Views . When I re-render
I have a view controller who's views are loaded from a nib file. The
I have view on which I defined a custom tagName. I need to be
i have view like 'home/details/5', it can be access by anonymous user. but there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.