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
Post a Comment