Are you checking the value of the environment variable inside of your GET function? The tests work by changing your environment variables, so you can’t check the value once in the global scope.
I moved it inside the app.get()- still isn’t working-
Error: The response of the endpoint /json should change according to the environment variable MESSAGE_STYLE
app.get //this is the git bracket begins->("/json", This is a req, res function ->(req, res)=>{res.json({“message”: “Hello json”});
const mySecret = process.env[‘MESSAGE_STYLE’];
var responce = “Hello json”.toUpperCase();
if (mySecret.MESSAGE_STYLE === “allCaps”) {
response = “Hello json”.toUpperCase();
} else {
response = “Hello json”;
};
});<- this is where the git bracket ends for the app.get( “blah”-location " blah" function const, var, if() else statement);
Is my brackets off? I am still a bit confused?