You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use many atob function in my postman collection; indeed, it not work in k6 script. However I found that I can easily fix it by using the k6/encoding module.
pm.test("Living JWT token", function () {
let jsonData = pm.response.json();
let Playload = JSON.parse(atob(jsonData.JWT.split(".")[1]));
let iat = new Number(Playload.iat);
let exp = new Number(Playload.exp);
let dateToSecond = Math.ceil(Date.now()/1000);
//check JWT token was issued in the past and expire in the future which means it is an effect token for now
pm.expect(dateToSecond).to.be.within(iat,exp);
});
I use many atob function in my postman collection; indeed, it not work in k6 script. However I found that I can easily fix it by using the k6/encoding module.
I want to ask is there any plan to support this kind of problem?
e.g. crypto-js -> k6/crypto
The text was updated successfully, but these errors were encountered: