kolodny / safetest

MIT License
1.31k stars 31 forks source link

OPT_URL #8

Closed MartinFerret closed 3 months ago

MartinFerret commented 3 months ago

Well, when running tests in examples/angular-app by npm run safetest, I get an error regarding the OPT_URL :

OPT_URL' is not recognised as an internal or external command or external command, an executable program or a command file.

What is this OPT_URL and how to use it ? Is it possible to upgrade the documentation and give us some tips ?

kolodny commented 3 months ago

This should be fixed with how SafeTest now uses cross-env. Can you pull the main branch and try again?

MartinFerret commented 3 months ago

I've just pulled @kolodny but I still get that same issue. Is someone else experiencing this ?

kolodny commented 3 months ago

What environment are you on?

MartinFerret commented 3 months ago

I'm on windows 11. The error occurs when I run npm run safetest

kolodny commented 3 months ago

Are you using command prompt, powershell, or a git-for-windows like shell?

MartinFerret commented 3 months ago

I'm using git bash UI for Windows, exactly.

kolodny commented 3 months ago

Can you try with branch fix-windows, you may need to change the OPT_URL part of the script with just

cross-env OPT_URL=http://localhost:4200/angular-app jest ...

Due to https://github.com/kentcdodds/cross-env/issues/140

MartinFerret commented 3 months ago

Undortunately it's not working as well, I get "cross'env is not an intern command...".

I've looked into it but can't solve it for now

kolodny commented 3 months ago

You need to run npm install from the root of the repo

MartinFerret commented 3 months ago

I did before running the script

kolodny commented 3 months ago

So you should be able to remove and env from package.json and just hardcode everything in the setup-safetest file

MartinFerret commented 3 months ago

The fix-windows branch works, thanks a lot