-
Notifications
You must be signed in to change notification settings - Fork 124
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
Legacy runtime API for Allure Mocha #975
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delatrie
force-pushed
the
mocha-backward-compat
branch
2 times, most recently
from
May 27, 2024 09:12
c03a83c
to
830fee4
Compare
- Code runners in addition to CLI - Testing of ESM/CJS samples - All combinations can be run in parallel mode
delatrie
force-pushed
the
mocha-backward-compat
branch
from
May 27, 2024 12:51
830fee4
to
b75f966
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
theme:api
Javascript API related issue
theme:mocha
Mocha related issue
type:improvement
Improvement or request
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
The legacy API makes Allure Mocha compatible with the code written against pre-3.0
allure-mocha/runtime
. The references are Allure.ts and MochaAllure.ts.Issues:
logStep
in the new Runtime API (not a big deal, since the legacylogStep
can be implemented in terms ofstep
;logStep
in 2.15.1 doesn't support custom statuses anyway, so we don't break it).attachment
's 3rd argument can be an instance ofAttachmentOptions
. The new API doesn't allow that. WhileAttachmentOptions.contentType
could be provided directly, there is no way to passAttachmentOptions.fileExtension
.TODO:
Extra changes
Reporter's new name
The reporter class's name now is
AllureMochaReporter
(following a general conventionAllure<Framework><ExtensionMechanism>
.CommonJS export change for AllureMochaReporter
The CommonJS build of Allure Mocha now exports the reporter class directly as
module.exports
. That allows users to specify the reporter via CLI:npx mocha --reporter allure-mocha ...
. That also makes the new version more look-alike with the previous one.More comprehensive testing of Allure Mocha
The test runner now allows to test running Mocha from code (both CommonJS and ESM). The behavior can be controlled with
ALLURE_MOCHA_TEST_RUNNER
env var, which supports the following values:cli
,cjs
, andesm
.ALLURE_MOCHA_TEST_SPEC_FORMAT
allows choosing between CommonJS (cjs
) and ESM (esm
) testing samples.ALLURE_MOCHA_TEST_PARALLEL
allows testing the parallel mode of Mocha.Currently, only the following two combinations are tested in the CI:
cli
, specs:esm
, parallel: nocli
, specs:esm
, parallel: yesESLint config changes
All files inside
dist
folders are now ignored by ESLint.Checklist