Coder Social home page Coder Social logo

Comments (12)

allphat avatar allphat commented on August 29, 2024

for a quick check, I've cloned this repo in a new folder.

If I run frisby_mock_request_spec.js, all tests pass.
Now, I edit this file changing :
"id": function(r) { expect(r).toBeType(Number); }, to "id": function(r) { expect(r).toBeType(String); },

I rerun this test ans it still passes

from frisby.

vlucas avatar vlucas commented on August 29, 2024

I will take a look at this. This definitely should not be happening.

from frisby.

vlucas avatar vlucas commented on August 29, 2024

Okay. I looked into this, and it's a bit weirder than the matcher not working. The matcher actually works perfectly. If you return from the function the result of the expect call, the test will fail.

Example:
"id": function(r) { return expect(r).toBeType(String); }

So the issue is that the Jasmine expectation is failing, but Frisby is somehow ignoring it if not returned directly. Running a few tests, it also does not add to the assertion count. It's almost like it's being run in a separate context or something. I will continue to investigate this issue, but I just wanted to give you a heads up in the meantime.

from frisby.

allphat avatar allphat commented on August 29, 2024

Thx for the update :)

from frisby.

TheRaven avatar TheRaven commented on August 29, 2024

I have a similar problem, but in afterJSON

from frisby.

jturmel avatar jturmel commented on August 29, 2024

Any word on this? It also seems to affect toBeTypeOrNull -- doesn't matter what you set it to Number, String, whatever...

from frisby.

katerberg avatar katerberg commented on August 29, 2024

This still appears to be an issue.

from frisby.

jjair81 avatar jjair81 commented on August 29, 2024

Seems like this is still the case for me too. I have some a json response as so:

{
"responseItems": 1,
"response": [ {
"element1": "some text",
"element2": "some text",
"element3": "some text",
} ]
}

doing a expect(val).toBeTypeOrNull(number/string/array/object) all work.

from frisby.

andrecastelo avatar andrecastelo commented on August 29, 2024

Still happening, returning the expect function. Also happens with toBeTypeOrNull.

from frisby.

sharadJay avatar sharadJay commented on August 29, 2024

any updates on this ?

from frisby.

vlucas avatar vlucas commented on August 29, 2024

I am working on the next version of Frisby, which will fix this issue. The main issue here is that Jasmine will not reliably run assertions in nested contexts.

from frisby.

vlucas avatar vlucas commented on August 29, 2024

Fixed in v2. Please update.

from frisby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.