Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bypass "deepEqual" for fuzzier expectations #19

Open
chrismcv opened this issue Dec 1, 2011 · 1 comment
Open

Bypass "deepEqual" for fuzzier expectations #19

chrismcv opened this issue Dec 1, 2011 · 1 comment

Comments

@chrismcv
Copy link

chrismcv commented Dec 1, 2011

Hi,
For certain assertions I'm making, I would rather so a looser equal on the result. I was wondering if there was a nice way of doing something like

 ....expect (200, { result { randomData: "*"}})

I basically want to assert on the structure of the response rather than the data/all of the data.

Thanks,
Chris

@domenic
Copy link

domenic commented Mar 13, 2013

I do stuff like this:

    .expect(401)
    .expect("should respond with error: invalid_client", function (err, res, body) {
        JSON.parse(body).should.have.property("error", "invalid_client");
    })

Here .should.have.property is using the Chai assertion library, but you could just use require("assert") of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants