Skip to content

Commit

Permalink
fix: fixed ci due to build differences on ubuntu vs mac
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Oct 19, 2023
1 parent 53cdd3e commit 2f3ba39
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 18 deletions.
38 changes: 26 additions & 12 deletions app/views/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -306,20 +306,34 @@ html.h-100.no-js(

if isBot(ctx.get('User-Agent'))
//- lazyload only support for bots
script(
defer,
src=manifest("js/lazyload.js"),
integrity=manifest("js/lazyload.js", "integrity"),
crossorigin="anonymous"
)
if config.env === 'test'
script(
defer,
src=`${config.urls.web}/js/lazyload.js`,
crossorigin="anonymous"
)
else
script(
defer,
src=manifest("js/lazyload.js"),
integrity=manifest("js/lazyload.js", "integrity"),
crossorigin="anonymous"
)
else
//- build
script(
defer,
src=manifest("js/build.js"),
integrity=manifest("js/build.js", "integrity"),
crossorigin="anonymous"
)
if config.env === 'test'
script(
defer,
src=`${config.urls.web}/js/build.js`,
crossorigin="anonymous"
)
else
script(
defer,
src=manifest("js/build.js"),
integrity=manifest("js/build.js", "integrity"),
crossorigin="anonymous"
)

//- TODO: remove plausible and migrate to our own
//- analytics via plausible.io
Expand Down
8 changes: 4 additions & 4 deletions test/web/snapshots/index.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Generated by [AVA](https://avajs.dev).
window._confirmPromptHTML = "Please confirm if you wish to continue.";␊
</script><script defer="defer">window.LOCALE = "en";␊
</script><script defer="defer">window.API_URL = "http://localhost:4000";␊
</script><script defer="defer" src="http://example.com:3000/js/build.4e66e47c.js" integrity="sha256-aE0ityWCt0hTm5e7FfWAsNu7XXSfSq+Iv9WSuXf49pA=" crossorigin="anonymous"></script><script defer="defer" data-domain="forwardemail.net" src="https://plausible.io/js/plausible.js"></script></body></html>`
</script><script defer="defer" src="http://example.com:3000/js/build.js" crossorigin="anonymous"></script><script defer="defer" data-domain="forwardemail.net" src="https://plausible.io/js/plausible.js"></script></body></html>`

## returns Spanish homepage

Expand Down Expand Up @@ -80,7 +80,7 @@ Generated by [AVA](https://avajs.dev).
window._confirmPromptHTML = "Por favor confirme si desea continuar.";␊
</script><script defer="defer">window.LOCALE = "es";␊
</script><script defer="defer">window.API_URL = "http://localhost:4000";␊
</script><script defer="defer" src="http://example.com:3000/js/build.4e66e47c.js" integrity="sha256-aE0ityWCt0hTm5e7FfWAsNu7XXSfSq+Iv9WSuXf49pA=" crossorigin="anonymous"></script><script defer="defer" data-domain="forwardemail.net" src="https://plausible.io/js/plausible.js"></script></body></html>`
</script><script defer="defer" src="http://example.com:3000/js/build.js" crossorigin="anonymous"></script><script defer="defer" data-domain="forwardemail.net" src="https://plausible.io/js/plausible.js"></script></body></html>`

## returns English ToS

Expand Down Expand Up @@ -233,7 +233,7 @@ Generated by [AVA](https://avajs.dev).
window._confirmPromptHTML = "Please confirm if you wish to continue.";␊
</script><script defer="defer">window.LOCALE = "en";␊
</script><script defer="defer">window.API_URL = "http://localhost:4000";␊
</script><script defer="defer" src="http://example.com:3000/js/build.4e66e47c.js" integrity="sha256-aE0ityWCt0hTm5e7FfWAsNu7XXSfSq+Iv9WSuXf49pA=" crossorigin="anonymous"></script><script defer="defer" data-domain="forwardemail.net" src="https://plausible.io/js/plausible.js"></script></body></html>`
</script><script defer="defer" src="http://example.com:3000/js/build.js" crossorigin="anonymous"></script><script defer="defer" data-domain="forwardemail.net" src="https://plausible.io/js/plausible.js"></script></body></html>`

## returns Spanish ToS

Expand Down Expand Up @@ -364,4 +364,4 @@ Generated by [AVA](https://avajs.dev).
window._confirmPromptHTML = "Por favor confirme si desea continuar.";␊
</script><script defer="defer">window.LOCALE = "es";␊
</script><script defer="defer">window.API_URL = "http://localhost:4000";␊
</script><script defer="defer" src="http://example.com:3000/js/build.4e66e47c.js" integrity="sha256-aE0ityWCt0hTm5e7FfWAsNu7XXSfSq+Iv9WSuXf49pA=" crossorigin="anonymous"></script><script defer="defer" data-domain="forwardemail.net" src="https://plausible.io/js/plausible.js"></script></body></html>`
</script><script defer="defer" src="http://example.com:3000/js/build.js" crossorigin="anonymous"></script><script defer="defer" data-domain="forwardemail.net" src="https://plausible.io/js/plausible.js"></script></body></html>`
Binary file modified test/web/snapshots/index.js.snap
Binary file not shown.
4 changes: 2 additions & 2 deletions test/web/snapshots/otp.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Generated by [AVA](https://avajs.dev).
window._confirmPromptHTML = "Please confirm if you wish to continue.";␊
</script><script defer="defer">window.LOCALE = "en";␊
</script><script defer="defer">window.API_URL = "http://localhost:4000";␊
</script><script defer="defer" src="http://example.com:3000/js/build.4e66e47c.js" integrity="sha256-aE0ityWCt0hTm5e7FfWAsNu7XXSfSq+Iv9WSuXf49pA=" crossorigin="anonymous"></script><script defer="defer" data-domain="forwardemail.net" src="https://plausible.io/js/plausible.js"></script></body></html>`
</script><script defer="defer" src="http://example.com:3000/js/build.js" crossorigin="anonymous"></script><script defer="defer" data-domain="forwardemail.net" src="https://plausible.io/js/plausible.js"></script></body></html>`

## GET otp/keys > successful

Expand All @@ -52,4 +52,4 @@ Generated by [AVA](https://avajs.dev).
window._confirmPromptHTML = "Please confirm if you wish to continue.";␊
</script><script defer="defer">window.LOCALE = "en";␊
</script><script defer="defer">window.API_URL = "http://localhost:4000";␊
</script><script defer="defer" src="http://example.com:3000/js/build.4e66e47c.js" integrity="sha256-aE0ityWCt0hTm5e7FfWAsNu7XXSfSq+Iv9WSuXf49pA=" crossorigin="anonymous"></script><script defer="defer" data-domain="forwardemail.net" src="https://plausible.io/js/plausible.js"></script></body></html>`
</script><script defer="defer" src="http://example.com:3000/js/build.js" crossorigin="anonymous"></script><script defer="defer" data-domain="forwardemail.net" src="https://plausible.io/js/plausible.js"></script></body></html>`
Binary file modified test/web/snapshots/otp.js.snap
Binary file not shown.

0 comments on commit 2f3ba39

Please sign in to comment.