mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-16 04:11:29 +00:00
39 lines
870 B
Plaintext
39 lines
870 B
Plaintext
meta {
|
|
name: getRandomValues
|
|
type: http
|
|
seq: 3
|
|
}
|
|
|
|
post {
|
|
url: https://echo.usebruno.com
|
|
body: none
|
|
auth: inherit
|
|
}
|
|
|
|
assert {
|
|
res.status: eq 200
|
|
}
|
|
|
|
tests {
|
|
const { getRandomValuesFunction, isUint8Array } = require('./scripting/inbuilt modules/utils.js');
|
|
|
|
// check if Uint8Array work as expected
|
|
test("should get random values", function() {
|
|
const uint8Array = new Uint8Array(32).fill(0);
|
|
const randomValueUint8Array = getRandomValuesFunction(new Uint8Array(uint8Array));
|
|
|
|
const isValueUint8Array = isUint8Array(randomValueUint8Array);
|
|
expect(isValueUint8Array).to.be.true;
|
|
|
|
const plainArray = Array.from(randomValueUint8Array);
|
|
expect(plainArray).to.be.of.length(32);
|
|
|
|
const ogPlainArray = Array.from(uint8Array);
|
|
expect(ogPlainArray).to.not.deep.eql(plainArray);
|
|
});
|
|
}
|
|
|
|
settings {
|
|
encodeUrl: true
|
|
}
|