filmov
tv
Check If An Array Of Strings Includes Another Array
![preview_player](https://i.ytimg.com/vi/1PffgLBGHWs/maxresdefault.jpg)
Показать описание
How do you check if one array of strings is a subset of another array of strings? You can use Chai assertion "include" to check each value one by one:
})
In Cypress, you can also use the Lodash _.difference method (Lodash is bundled with Cypress) to compute the difference array. If there are no extra values, that difference should be empty
const difference = Cypress._.difference(list, countries)
})
In Cypress, you can also use the Lodash _.difference method (Lodash is bundled with Cypress) to compute the difference array. If there are no extra values, that difference should be empty
const difference = Cypress._.difference(list, countries)