8000 Weird node error when testing with Jest · Issue #68 · mjackson/mach · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Weird node error when testing with Jest #68

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

Open
blainekasten opened this issue Mar 13, 2015 · 1 comment
Open

Weird node error when testing with Jest #68

blainekasten opened this issue Mar 13, 2015 · 1 comment

Comments

@blainekasten
Copy link

So i'm trying to implement this in a React project and am using Jest to test with. I'm currently getting this error when triggering a fucntion that calls the mach code

/Location.js: Property description must be an object: undefined

My code that is triggering this looks like:

login() {
    mach.post({
      url: url,
      params: {...},
      headers: {
        'X-CSRF-TOKEN': token
      }
    }).then(() => location.reload());
}

node 0.10, jest 0.2.2

@blainekasten blainekasten changed the title We're node error when testing with Jest Weird node error when testing with Jest Mar 13, 2015
@mjackson
Copy link
Owner

I haven't ever played around with Jest, but my understanding is that it mocks everything you require. Thus, it's probably mocking some function that mach needs (maybe in the describe-property module?) and returning undefined.

In any case, I wouldn't recommend using mach with Jest as I haven't tested it yet.

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

No branches or pull requests

2 participants
0