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

Allure-mocha is not compatible with --check-leaks option #37

Closed
1 of 3 tasks
just-boris opened this issue Aug 21, 2019 · 2 comments · Fixed by #39 or #46
Closed
1 of 3 tasks

Allure-mocha is not compatible with --check-leaks option #37

just-boris opened this issue Aug 21, 2019 · 2 comments · Fixed by #39 or #46

Comments

@just-boris
Copy link
Contributor

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

When I use --check-leaks flag, my tests fail.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

It can be reproduced in the demo package. Add the --check-leaks flag here and see the output:

0 passing (102ms)
  2 failing

  1) Authorization
       "before each" hook:
     Error: global leaks detected: allure, cache


  2) Authorization
       Sergey Korol should be able to sign:
     Error: No executable!
      at MochaAllureInterface.get [as currentExecutable] (node_modules/mocha-allure2-reporter/src/MochaAllureInterface.ts:124:13)

What is the expected behavior?

Reporter should be compatible with any mocha option.

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

Allure version 2.7.0
Test framework mocha@5.2.0
Allure adaptor allure-mocha@latest
Generate report using n/a
@just-boris
Copy link
Contributor Author

just-boris commented Aug 21, 2019

The suggested solution would be to move away from globals in the API and use the import in every test that uses Allure runtime:

import allure from 'allure-mocha/runtime';

allure.step('Do something', () => console.log('Hi!'));

This is not only solves the mentioned issue, but makes the code more typescript-friendly.

@just-boris
Copy link
Contributor Author

Closed by mistake. Should stay open

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