Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

97
Views
how to set undefined variable error in js for test cases
var editor;
return Backbone.Marionette.ItemView.extend({
      onShow:function(){
           editor=_.clone(ace);
            .................
      }
       enable:function(){
            edit.onPaste = editor.onPaste;
             ..............
      }
}

I am new to js Now i want to write a test case for the function enable. here editor is declared as global and is intialized in onshow function. i am getting editor as undefined in the test for enable function, how to resolve this. please help me Thank you.

The test case is like

it('Case #1:Check the enablerule Action function',function(){             
   expect(complexView.enableruleAction(view)).to.equal(undefined);
            });
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!