dareid/chakram

Invalid validation keywords and types

Open

#27 ouverte le 26 nov. 2015

Voir sur GitHub
 (4 commentaires) (0 réactions) (0 assignés)JavaScript (100 forks)batch import
enhancementhelp wanted

Métriques du dépôt

Stars
 (907 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

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.

Guide contributeur