javascript - How to use jasmine toMatch multiple arguments? -


how can test if variable match multiple options in jasmine? want this, checking if taxonomytype matches 1 of 3 options 'gem', 'pager' or 'atc58':

expect(taxonomytype).tomatch({'gem', 'pager', 'atc58'}); 

you reverse , use tocontain

var = ['gem', 'pager', 'atc58'];   expect(a).tocontain(taxonomytype); 

or write own loop (or use lodash/underscore) determine "found" , compare result true/false

expect(_.includes(['gem', 'pager', 'atc58'], taxonomytype)).tobe(true); 

Comments

Popular posts from this blog

symfony - InvalidConfigurationException in SecurityExtension.php line 429: No authentication listener registered for firewall "secured_area" -

angular ui router - 10 digest iterations reached in angularjs when using $state.go -

javascript - Handling constructor related functions while testing with mocha and sinon -