hugomrdias / playwright-test

Run unit tests with several test runners or benchmark inside real browsers with playwright and other Javascript runtimes.
MIT License
100 stars 12 forks source link

[feature]: Assets from multiple directories #652

Open marcus-pousette opened 5 months ago

marcus-pousette commented 5 months ago

Is your feature request related to a problem? Please describe. I am trying to create a Web Worker from a script that lives in a dependency, but in order to server this file I somehow need to make it an asset of the polka server. It seems like I now have to copy it into the root directory of the project I want to test to make it work

Describe the solution you'd like I would be great if I somehow could bundle and provide it without having to manually copy the the asset to the same folder as cwd. The --assets command does not do what I expect, it seems to just rewrite where the asset folder is.

Describe alternatives you've considered Make a script that copies the worker scripts into some temp folder that is inside of root folder of the project

hugomrdias commented 5 months ago

--assets is just a flag to provide a folder to be served as static assets you can point it to any folder

Any suggestions to make it more clear?

You need to serve multiple folder as static assets? For multiple we gonna need to name different urls for different folder

Hugo Dias

On Wed, Apr 3, 2024, 09:03 Marcus Pousette @.***> wrote:

Assigned #652 https://github.com/hugomrdias/playwright-test/issues/652 to @hugomrdias https://github.com/hugomrdias.

— Reply to this email directly, view it on GitHub https://github.com/hugomrdias/playwright-test/issues/652#event-12336993602, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACMWTXM7GQTWTNYU35XNQTY3OZVPAVCNFSM6AAAAABFUZGXFSVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJSGMZTMOJZGM3DAMQ . You are receiving this because you were assigned.Message ID: @.***>

marcus-pousette commented 5 months ago

Yeap, but that will also make it point away from cwd..

Did a quick PR to show what I mean https://github.com/hugomrdias/playwright-test/pull/653

Naming is not really a problem I think, because if you serve the files under a folder the path will have folder in its name.

marcus-pousette commented 2 months ago

friendly bump :)