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

feat(cypress): differentiate browser/node in exports #1203

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

delatrie
Copy link
Collaborator

@delatrie delatrie commented Dec 2, 2024

Context

The PR adds the node and browser conditions into allure-cypress's exports section, which allows importing "allure-cypress" in both the browser and the Node sides:

import "allure-cypress"; // the browser side code in support/e2e.js
import { allureCypress } from "allure-cypress"; // in cypress.config.js
import { allureCypress } from "allure-cypress/reporter"; // the same as above; backward compatibility

Additionally, users who mistakenly import "allure-cypress/reporter" in the browser-side code will get a more clear Could not resolve "allure-cypress/reporter" error instead of failing somewhere deep inside of "allure-js-commons" code with some failed Node-related import like "node:fs".

@delatrie delatrie added the type:improvement Improvement or request label Dec 2, 2024
Base automatically changed from package-exports-order-fix to main December 2, 2024 11:34
@github-actions github-actions bot added theme:api Javascript API related issue theme:mocha Mocha related issue theme:jest Jest related issue theme:cucumberjs CucumberJS related issue theme:jasmine Jasmine related issue theme:playwright theme:codeceptjs theme:vitest labels Dec 2, 2024
@delatrie delatrie force-pushed the cypress-exports-new-conditions branch from d522ee3 to cf6c183 Compare December 2, 2024 11:49
@github-actions github-actions bot removed theme:api Javascript API related issue theme:mocha Mocha related issue theme:jest Jest related issue theme:cucumberjs CucumberJS related issue theme:jasmine Jasmine related issue theme:playwright theme:codeceptjs theme:vitest labels Dec 2, 2024
@delatrie delatrie marked this pull request as ready for review December 2, 2024 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:improvement Improvement or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant