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?
-
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.cyberbrain– cyberbrain2025年10月23日 07:47:25 +00:00Commented 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)Oleg– Oleg2025年10月23日 08:03:04 +00:00Commented 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...cyberbrain– cyberbrain2025年10月23日 08:09:23 +00:00Commented Oct 23, 2025 at 8:09