Since I have install jasmine LTS from sfdx am using jasmine/2.6.1 . Write a test as said in the example for c:egGlobalValueProvider But I am getting an error in scratch org :TypeError: component.find is not a function

    <c:lts_jasmineRunner testFiles="{!join(',', 
)}" />

and in lts_JasmineRunner.cmp :

<aura:component extensible="true">
    <aura:attribute name="testFiles" type="String[]" required="true" description="list of test spec files"/>

    <!--  placeholder div which example test specs use to render components under test -->
    <div aura:id="renderTestComponents" id="renderTestComponents"></div>

    <!-- Placeholder div for jasmine test results  -->
    <div id="jasmineHtmlTestResults"/>

    <!-- Pull in jasmine, utils and the test specs specified by the consuming wrapper test app  -->
    <ltng:require scripts="{!join(',', 
        $Resource.lts_jasmine + '/lib/jasmine-2.6.1/jasmine.js',
        $Resource.lts_jasmine + '/lib/jasmine-2.6.1/jasmine-html.js',
        $Resource.lts_jasmine + '/lib/jasmine-2.6.1/jasmine.css'
        afterScriptsLoaded="{!c.runTests}" />



describe("Lightning Component Testing Examples", function(){

    describe('c:egGlobalValueProvider', function(){
        it('renders a custom label', function(done) {
            $T.createComponent("c:egGlobalValueProvider", {}, true)

                //var that=this;

                var greetingLabelVal = $A.get("$Label.c.greeting");


            }).catch(function(e) {


Lightning component :

 <aura:attribute name="_recordId" type="String" />
    <div aura:id="greeting">{!$Label.c.greeting}</div>

Got this error : enter image description here

i though its about version of jasmin but after upgrade to 3.0.0 also getting same error

Note : update sfdx and install lts too

  • Could you please copy and paste the relevant source code and error messages into your question, using Ctrl-K or the {} tool to format them, rather than posting screenshots? – David Reed Nov 30 at 22:09

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.