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

Testing helper TCModelFactory doesn't work anymore. #418

Open
nejcsever opened this issue Sep 9, 2023 · 1 comment
Open

Testing helper TCModelFactory doesn't work anymore. #418

nejcsever opened this issue Sep 9, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@nejcsever
Copy link

Module
@iabtechlabtcf/testing

Version
1.5.9

Description
With the new GVL v3 (TCF 2.2) support, TCModelFactory stopped working.

Functions TCModelFactory.noGVL(); and TCModelFactory.withGVL(); throw the following error:
Error: Cannot find module './vendorlist/v2/vendor-list.json' from 'node_modules/@iabtechlabtcf/testing/lib/cjs/GVLFactory.js'

The reason is that TCModelFactory uses GVLFactory.getLatest() inside which calls the GVL resource with schema value of "v2" and for "v2" there's no latest vendor list json (./vendorlist/v2/vendor-list.json). This only works with "v2.2" passed as a schema parameter in GVLFactory.getLatest("v2.2").

The solution would be to change the default behaviour or add schema or any other parameters to the TCModelFactory functions.

I worked around this issue by manually creating TCModel and attaching gvl with GVLFactory.getLatest("v2.2") but I thought it's worth reporting that TCModelFactory is broken with the TCF 2.2 updates.

@harrykingriches
Copy link

Hey @nejcsever I found the cause of the issue. NPM does not include symlinks when it is packing the files to be published. Only the vendor-list.json inside v2.2 is not a symlink which is why it appears there and not in v2. Link to PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants