Skip to content

Instantly share code, notes, and snippets.

@awendland
Created June 18, 2016 21:30
Show Gist options
  • Save awendland/f42645abb14b724981e3d860471055e0 to your computer and use it in GitHub Desktop.
Save awendland/f42645abb14b724981e3d860471055e0 to your computer and use it in GitHub Desktop.
Chai unordered array equality
const expect = require('chai').expect;
const arr = ['email', 'password'];
expect(arr).to.have.members(['email', 'password']); // true
expect(arr).to.have.members(['email']); // false
expect(arr).to.have.members(['email', 'password','extra']); //false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment