faker icon indicating copy to clipboard operation
faker copied to clipboard

test: verify the generated image links are working

Open ST-DDT opened this issue 1 year ago • 3 comments

Fixes #3112

  • #3112

This PR adds a test to the image module/all methods that return a url that actually points to something to ensure the url is working as expected.

Thoughts and Considerations

The current setup only runs these tests in CI to avoid running into "this service might be tracking you" issues when running the tests locally.

ST-DDT avatar Sep 21 '24 10:09 ST-DDT

Deploy Preview for fakerjs ready!

Name Link
Latest commit 4f96e95aecdb257941297df0453c2337110f5afd
Latest deploy log https://app.netlify.com/sites/fakerjs/deploys/672f395ad5c12c00080f173d
Deploy Preview https://deploy-preview-3127.fakerjs.dev
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Sep 21 '24 10:09 netlify[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.96%. Comparing base (0d85075) to head (4f96e95). Report is 1 commits behind head on next.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #3127   +/-   ##
=======================================
  Coverage   99.96%   99.96%           
=======================================
  Files        2805     2805           
  Lines      217115   217115           
  Branches      976      979    +3     
=======================================
+ Hits       217044   217048    +4     
+ Misses         71       67    -4     

see 2 files with indirect coverage changes

codecov[bot] avatar Sep 21 '24 10:09 codecov[bot]

The current provided solution feels like mixin unit with integration tests. IMO we should split them from each other. That way, because we rely here also on external sources, we could execute this in a scheduled workflow e.g. every week or so, so we also reduce the "ddos" outgoing from this repo.

Shinigami92 avatar Sep 21 '24 11:09 Shinigami92

Team Decision

  • We will move these tests to integration-test/test/integration
  • We will run the integration test once a week

ST-DDT avatar Oct 26 '24 14:10 ST-DDT

@xDivisionByZerox Like this or should I really use a separate folder structure?

ST-DDT avatar Oct 29 '24 13:10 ST-DDT

@xDivisionByZerox Like this or should I really use a separate folder structure?

Thats how I do it in my projects, but I have my test files next to the actual implementation.

  • directory
    • file.ts
    • file.spec.ts (unit tests)
    • file.(integration|int|it)[.-]spec.ts
    • file.(e2e|cy)[.-]spec.ts

The structure feels natural to me.

Since the tests are already in a separate directory, one might suggest splitting integration and unit tests into two directories as well:

  • test
    • integration
    • file.(integration|int|it)?[.-]spec.ts
    • unit
    • file.spec.ts

On advantage would be that the test setup file might be more linear, since the file patter can be a diretory instead of a "crazy" pattern. Additionally, if integration tests do not have to follow the same structure like unit tests do, this might be a good approche as well.

xDivisionByZerox avatar Oct 30 '24 23:10 xDivisionByZerox

There are currently too many open PRs to move the unit tests to a subfolder. So I will only move the integration tests to a subfolder.

ST-DDT avatar Oct 31 '24 10:10 ST-DDT