Open TheCoderGuyVlad opened 1 year ago
Hi @xk0der, @mcdan, @chrisscott. @ssteinerx, Could you please tell me if calling Newman from TypeScript is supported? And if so, what is the proper way to import it into my project? (The suggestions I tried online haven't worked)
Thank you!
I am not sure if this is a proper solution or not, but I added the following code in package.json and for me the issue was resolved and now I am facing issues in the run time while executing newman.run See if this makes sense for you.
"browser": {
"fs": false,
"path": false,
"os": false,
"crypto": false,
"querystring": false,
"http": false,
"https": false,
"net": false,
"tls": false,
"zlib": false,
"dgram": false
}
Is there an update on this issue? I am also experiencing it with the following specs:
Newman Version: 5.3.2 OS details: Windows 10 Are you using Newman as a library, or via the CLI?: As a Library in an Angular application. (Angular version: 15.0.0; Node version: 18.17.1; TypeScript version: 4.8.2) Did you encounter this recently, or has this bug always been there: Same as @TheCoderGuyVlad Expected behavior: To be able to run a Postman collection via Newman on my Angular UI. Command / script used to run Newman: Same as @TheCoderGuyVlad Sample collection, and auxiliary files (minus the sensitive details): The default request to get all collections: https://api.getpostman.com/collections
Any information on the issue would be much appreciated!
Hi Newman Team,
I have successfully used Newman for a while via the Mac command line and a couple times worked on some Node JS scripts that call it as a library. Both of these worked beautifully! Thank you!
But I am now trying to call Newman in my Angular UI (written in TypeScript), and I am not able to get this to work for some reason.
Could you please help me understand what I am doing wrong, or let me know if it is not possible?
Background / Assumptions: I assumed that since Newman can run in JavaScript (and TypeScript is backwards compatible with JavaScript) then it should be able to work in an Angular UI that's written in TypeScript. Also, according to this StackOverflow answer this seemed to be supported. (At least back in 2020)
Here is my Angular component code snippet:
I have tried to load the Newman library into my project folder via the following commands:
npm install @types/newman --save
npm install newman
andnpm i -S newman
, but both these caused more errors during compilation, like it was trying to recompile the whole Newman library and failing due to missing dependencies. Here are some error examples:But sadly this didn't help either. It still gave same errors saying these modules were missing.
My version and environment information:
newman.run
}npm install @types/newman --save
: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ < > ~ ~ < > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Usingnpm install newman
: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ < > ~Thank you for your support!