Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

With Squire.js Tests Run Always Positive No Matter What. #311

Closed
Millad opened this Issue · 1 comment

1 participant

@Millad

I'm using Require.js to use AMD in my project. I use it in my project and in my Jasmine tests with no problems.

I'm using Squire.js to mock my DAO classes in my Services. When I expect the test to fail in a simple as a true to be false the test should fail but it does not fail. Even expect 2 to be 3 runs positive and green but only inside the require space like so:

define(
[
"Squire",
"DAO/MockUserDAO"
],
function(Squire,MockUserDAO){
describe("UserService",function(){

        it("should return an array of  4 users on getAll()",function(){

            var squire = new Squire();

            squire.mock(["DAO/UserDAO"],MockUserDAO)
                .require(["services/UserService"], function(UserService){
                            var userCount = UserService.getAll().length;
                            expect(2).toBe(1);  // DOES NOT FAIL!
                        }); 

        });

        it("should return true",function(){
            expect(true).toBe(false);  // FAILS as expected.
        });


    }); 

}

);

@Millad Millad closed this
@Millad

It worked when using the library jasmine.async

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.