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

Inline arrow function support for expect.js #162

Open
Hugodby opened this issue Apr 16, 2019 · 1 comment
Open

Inline arrow function support for expect.js #162

Hugodby opened this issue Apr 16, 2019 · 1 comment

Comments

@Hugodby
Copy link

Hugodby commented Apr 16, 2019

Hi,
I trying to migrate off expect.js. It works fine for most of the tests. However, when the expect call is inline it isn't converted:

# WRONG: this is ignored

return model.generate(TITLE)
  .then((id) => expect(id).to.be.ok());

# This should be converted to

return model.generate(TITLE)
  .then((id) => expect(id).toBeTruthy());

However, when I use { } to declare the function it works:

# OK: This

return model.generate(TITLE)
  .then((id) => {
    expect(id).to.be.ok()
  });

# is successfuly converted to

return model.generate(TITLE)
  .then((id) => {
    expect(id).toBeTruthy()
  });
@skovhus
Copy link
Owner

skovhus commented Apr 23, 2019

@Hugodby thanks for reporting this. Let me know if you want to give it a go.

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

2 participants