dareid/chakram

Invalid validation keywords and types

Open

#27 aperta il 26 nov 2015

Vedi su GitHub
 (4 commenti) (0 reazioni) (0 assegnatari)JavaScript (100 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (907 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

    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.

Guida contributor