Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
59
rated 0 times [  60] [ 1]  / answers: 1 / hits: 16760  / 7 Years ago, fri, december 22, 2017, 12:00:00

I know the solution for Postman with Chrome Plugin....



the solution for my Postman with Chrome Plugin is
on my mbp
I've just add these line also put the moment.min.js (or any javascript file) as path described



<script type=text/javascript src=../js/tester/moment.min.js></script>


at the path



~/Library/Application Support/Google/Chrome/Default/Extensions/fhbjgbiflinjbdggehcddcbncdddomop/5.4.0_0/html/


in a file



tester_sandbox.html


for able to use moment in Tests
or



requester.html


for able to use moment in Pre-request Script



but i can't find where the Postman Native App keeps these file path....



i've already try another solution that i found on google about
add the script as an GlobalVariable then eval in Tests but it's still not work...



any ideas or any recommended ......



thanks


More From » testing

 Answers
7

To use moment you need to add this to the top of you pre-request scripts or tests tab



var moment = require('moment')


Then you can use the module as per the docs.



moment().add(2, 'days').format()


Or whatever you need...


[#55611] Tuesday, December 19, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
americar

Total Points: 631
Total Questions: 107
Total Answers: 103

Location: Luxembourg
Member since Tue, Jan 25, 2022
2 Years ago
;