dareid/chakram

Invalid validation keywords and types

Open

#27 opened on Nov 26, 2015

View on GitHub
 (4 comments) (0 reactions) (0 assignees)JavaScript (100 forks)batch import
enhancementhelp wanted

Repository metrics

Stars
 (907 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

    it("should list all avilable players", function () {
        var responseStructure = {
            type: "array",
            properties:{
                enabled : {type:"string"},  //This is expected to be an integer, but test passes
                defaultLanguage :{type:"integer"},
                defaultCurrency :{type:"integer"},
                lastname :{type:"string"},
                firstname:{type:"string"},
                passwordSalt:{type:"string"},
                password:{type:"string"},
                email:{type:"string"},
                id:{type:"string"} //Also this, expected to be an integer, but it passes the test
            }
        }
        var response = chakram.get(endpoint);
        return expect(response).to.have.schema(playerDataStructure);

I observed that the properties are not checked even when the properties expected doesn't match the types in the reponse, the test still passes.

Contributor guide