Skip to content

Instantly share code, notes, and snippets.

@vdespa
Created April 2, 2019 10:58
Show Gist options
  • Save vdespa/73ce40a23efc76f0148719af9ae80861 to your computer and use it in GitHub Desktop.
Save vdespa/73ce40a23efc76f0148719af9ae80861 to your computer and use it in GitHub Desktop.
Simple example for reusing Postman scripts
const commonTests = () => {
pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});
}
pm.globals.set('commonTests', commonTests.toString());
eval(pm.globals.get('commonTests'))();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment