thheller / shadow-cljs

ClojureScript compilation made easy
https://github.com/thheller/shadow-cljs
Eclipse Public License 1.0
2.23k stars 173 forks source link

Srting handling different to clj #1175

Closed jerger closed 4 months ago

jerger commented 4 months ago

At https://repo.prod.meissa.de/meissa/c4k-website/src/branch/main/src/test/cljc/dda/c4k_website/website/website_internal_test.cljc#L82-L83

We test-compare strings containing ^and $. This works in case of clj but not in case of cljs.

Testfailure says

expected: (= "server {\n  listen 80 ...  location / {\n    try_files $uri $uri/ /index.html =404;\n  }\n  # redirects\n  rewrite ^/products.html$ /offer.html permanent;\n  rewrite ^/one-more$ /redirect permanent;\n}\n" (:website.conf (:data (cut/generate-nginx-configmap {:forgejo-repo "none", :redirects [["/products.html" "/offer.html"] ["/one-more" "/redirect"]], :forgejo-host "gitea.evilorg", :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"], :build-cpu-limit "1700m", :build-cpu-request "500m", :build-memory-limit "512Mi", :build-memory-request "256Mi", :issuer "staging", :branchname "mablain", :unique-name "test.io", :volume-size "3"}))))
  actual: (= "server {\n  listen 80 ...  location / {\n    try_files $uri $uri/ /index.html =404;\n  }\n  # redirects\n  rewrite ^/products.html$ /offer.html permanent;\n  rewrite ^/one-more$ /redirect permanent;\n}\n" "server {\n  listen 80 default_server;\n  listen [::]:80 default_server;\n  server_name test.de www.test.de test-it.de www.test-it.de;\n  add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';      \n  add_header X-Frame-Options \"SAMEORIGIN\";\n  add_header X-Content-Type-Options nosniff;\n  add_header Referrer-Policy \"strict-origin\";\n  # add_header Permissions-Policy \"permissions here\";\n  root /var/www/html/website/;\n  index index.html;\n  location / {\n    try_files $uri $uri/ /index.html =404;\n  }\n  # redirects\n  rewrite ^/products.html\\$ /offer.html permanent;\n  rewrite ^/one-more\\$ /redirect permanent;\n}\n"))
thheller commented 4 months ago

Uhm, I'm not sure what you are reporting here? I'm not going to debug your test for you.

shadow-cljs only builds the CLJS code, it has little to no impact on what it does when running. It is not the place to report differences from CLJ to CLJS. There are differences between JS and JVM, so where it is different you'll have to find on your own.

Closing this as there is nothing actionable I can do here.