0

I have a frontend repo, in which I have a subdirectory named share-test-ids. I have a package.json there

{
 "name": "shared-test-ids",
 "version": "1.0.0",
 "type": "module",
 "exports": {
 "./test-attributes": "./attributesForTests.js"
 },
 "files": [
 "./attributesForTests.js"
 ]
}

and, of course, the attributesForTests.js file. The idea was to share data-test attributes with a QA team, which uses the same attributes in their PlayWright repo. Right now they just copy/paste manually all the attributes we add, and it feels off. So, I added to the QA repo the following line: "shared-test-ids": "git+ssh://[email protected]_name.com/subcompany/frontend/project-name/#attributes_share" The name of a frontend branch is attributes_share. How can I specify here the subfolder shared-test-ids, so npm i will look not for the root package.json, but for the package.json from the subfolder? I tired ...#attributes_share:/shared-test-ids, ...#attributes_share/shared-test-ids and some other options, but I either get an error (no such path found) or get a warning that npm just will ignore the unknown syntax.I used to have only one package.json and I exported attributesForTest.js from there, and successfully imported them as a npm package, but when I ran npm i it installed all the frontend dependencies from my frontend repo, and I just want to share that single file with the QA team. Am I on the right way? Or is there a way to achieve the same goals somehow easier?

asked Oct 23, 2025 at 7:43
3
  • If you share that actual file with the QA Team - what does the test do? Check if the correct file is shared? It will not test that the correct attributes are used then. Commented Oct 23, 2025 at 7:47
  • The thing is, right now we don't share anythign. QA team just adds data-test which they found in devtools (they have branches deployed on instances, so they can manually test the app and also find the data-test attributes to write tests) Commented Oct 23, 2025 at 8:03
  • IMHO QA should derive its test data from the requirements and not from some files the developers already test with - otherwise they will just test everything again with no real benefit towards improved quality of the software. But that is for sure off-topic for SO... Commented Oct 23, 2025 at 8:09

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.