Closed erwinmombay closed 2 years ago
@sebastianbenz could you give some guidance on how to write an end to end test for this. I want to make sure the RewriteAmpUrls transformer doesn't conflict with how i'm writing the code here and doesn't do something like "lts/lts" in its path
You can add end-to-end tests via these steps:
npm run test:optimizer:snapshot
to generate the expected output@sebastianbenz is there a way to similarly turn on an experiment flag in end-to-end tests like how i did it with lts as a comment or through a config.json?
e2e tests automatically run for default, lts and paired.
(paired doesn't make sense in the story sense, so it's safe to ignore)
@sebastianbenz would it make sense for me to create a "experimental" spec where i turn on experimental flags?
How about creating a story specific configuration here: https://github.com/ampproject/amp-toolbox/blob/main/packages/optimizer/spec/end-to-end/EndToEndSpec.js#L33
@sebastianbenz PTAL. (tests are failing because main is broken, needs https://github.com/ampproject/amp-toolbox/pull/1272 merged)
@sebastianbenz tests are green now. Please take another look. Thanks!
LGTM, one suggestion
committed suggestion. should be green now and mergeable
Thanks Erwin!