Select to view content in your preferred language

WAB - Unit Testing

2350
2
12-15-2015 07:42 AM
caseycupp
Deactivated User

Has anyone been successful with getting unit testing working with their own WAB app. (We've taken the stemapp and added widgets, and made a few updates to pre-built widgets)

I've tried adding jasmine to my project, but can't seem to get the require / config file set right..

I also tried using the existing DOH framework inside the dojo pieces, but that didn't work either. (actually worked, but wasn't able to get it to work with super simple tests inside the DOH folders, but nothing outside of those folders.. like my actual app.

Has anyone else had any luck.. Any suggestions.

Casey

(PS I posted this last week, but I don't think it ended up here in the WAB area.

0 Kudos
2 Replies
caseycupp
Deactivated User

FYI.. here is my specrunner.js

require.config({

    urlArgs: 'cb=' + Math.random(),

    paths: {

        jquery: 'libs/jquery',

        dojo: 'libs/dojo',

        jasmine: 'libs/jasmine/lib/jasmine',

        'jasmine-html': 'libs/jasmine/lib/jasmine-html',

        spec: 'libs/jasmine/spec/'

    },

    shim: {

        jasmine: {

            exports: 'jasmine'

        },

        'jasmine-html': {

            deps: ['jasmine'],

            exports: 'jasmine'

        }

    }

});

0 Kudos
Vara_PrasadM_S
Frequent Contributor

Hey, we are also looking for any best approach to do Unit Testing for WAB custom widgets. Could you please let me know if you find any good working approach for this.

Thanks & Regards,

Vara Prasad.

0 Kudos