mirror of
https://github.com/usebruno/bruno.git
synced 2025-01-24 22:58:44 +01:00
753a576c3c
Safe Mode Sandbox using QuickJS Co-authored-by: Anoop M D <anoop.md1421@gmail.com> Co-authored-by: lohit <lohit.jiddimani@gmail.com>
27 lines
471 B
Plaintext
27 lines
471 B
Plaintext
meta {
|
|
name: uuid
|
|
type: http
|
|
seq: 1
|
|
}
|
|
|
|
get {
|
|
url: {{host}}/ping
|
|
body: none
|
|
auth: none
|
|
}
|
|
|
|
script:pre-request {
|
|
const { v4 } = require("uuid");
|
|
|
|
bru.setVar("uuid-test-id", v4());
|
|
}
|
|
|
|
tests {
|
|
test("uuid var", function() {
|
|
const id = bru.getVar('uuid-test-id');
|
|
let isValidUuid = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(id);
|
|
bru.setVar('uuid-test-id', null);
|
|
expect(isValidUuid).to.eql(true);
|
|
});
|
|
}
|