# Pm.expect is not working on newman

**URL:** <https://community.postman.com/t/pm-expect-is-not-working-on-newman/31631>\
**Category:** Help Hub\
**Tags:** newman-project\
**Created:** [January 17, 2022, 10:25pm UTC](https://community.postman.com/t/pm-expect-is-not-working-on-newman/31631 "2022-01-17T22:25:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![patpostman](https://avatars.discourse-cdn.com/v4/letter/p/e480ec/32.png) [@patpostman](https://community.postman.com/u/patpostman)\
**Post date:** [January 17, 2022, 10:25pm UTC](https://community.postman.com/t/pm-expect-is-not-working-on-newman/31631/1 "2022-01-17T22:25:16Z")

</div>

> **Archived topic — this may be out of date.**  
> Newman has been replaced by the **[Postman CLI](https://learning.postman.com/docs/postman-cli/postman-cli-overview/)**, Postman’s official, signed command-line tool. It runs collections as Newman did, and also lints API specs, runs mocks and monitors, and syncs local files with Postman from your terminal, CI/CD pipeline or coding agent.  
> Working with an AI coding agent? The [Postman plugin](https://github.com/postmanlabs/postman-plugin) lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.  
> For current help, see the [Postman docs](https://learning.postman.com/docs/), try the free [Postman tools](https://www.postman.com/tools) (no account needed), or join us on [Discord](https://discord.gg/58aNNsRBGR).

_My question_:  
pm.expect is not working on newman  
for example, pm.expect(1).to.eql(0); would fail in postman  
but if i run it in newman the test just passes

---

<div class="post-metadata">

**Author:** ![patpostman](https://avatars.discourse-cdn.com/v4/letter/p/e480ec/32.png) [@patpostman](https://community.postman.com/u/patpostman)\
**Post date:** [January 17, 2022, 10:30pm UTC](https://community.postman.com/t/pm-expect-is-not-working-on-newman/31631/2 "2022-01-17T22:30:05Z")

</div>

I think I know why the expect failed, it was inside a cookieJar.getAll(url, (err, cookies) =\> { }  
How can I make it work inside it though?
