Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use with jest #53

Open
qingfengpai opened this issue Jul 8, 2018 · 8 comments
Open

how to use with jest #53

qingfengpai opened this issue Jul 8, 2018 · 8 comments

Comments

@qingfengpai
Copy link

No description provided.

@teppeis
Copy link
Contributor

teppeis commented Jul 8, 2018

Sorry, I don't use Jest with this package. Someone could help?

@twada
Copy link
Member

twada commented Jul 9, 2018

Me neither. So labeled as help wanted.

@karak
Copy link

karak commented Jul 9, 2018

@qingfengpai
I'm not a user of power-assert but ts-jest may help you.
Sample: https://github.com/karak/power-assert-ts-jest

@twada
Copy link
Member

twada commented Jul 9, 2018

@karak Thanks a lot!!

@YusukeHirao
Copy link

@karak
I expect to report

 - Expected
    + Received

    - Object {
    -   "greeting": "Hello",
    - }
    + Object {}

      assert.equal({}, { greeting: "Hello" })
                   |   |
                   |   Object{greeting:"Hello"}
                   Object{}

but actual result

    - Expected
    + Received

    - Object {
    -   "greeting": "Hello",
    - }
    + Object {}

      2 |
      3 | it("hello", () => {
    > 4 |   assert.equal({}, { greeting: "Hello" });
        |          ^
      5 | });
      6 |

Have you hit on any possible causes of the problem?

@karak
Copy link

karak commented Jul 12, 2018

I confirmed the version of pure-js gave the same result, and can only say "power-assert" and/or "jest" may have some problems rather than TypeScript.

ADD:

The following command-lines are against your expects as well.

npx jasmine hello.test.js
npx mocha hello.test.js

Is the usage of power-assert correct? I'm not sure.

@YusukeHirao
Copy link

@karak
Thank you, sorry for asking too much.
Let me check it out.

@taichi
Copy link

taichi commented Oct 31, 2018

i made quick example here. https://gist.github.com/taichi/d000fa1eba03889be58bdf985c922f87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants