Closed MartinFerret closed 3 months ago
I just pushed a change to the fix-windows branch. Can you try again. I was able to get this to work on my windows machine using the vanilla command prompt. You'll need to
npm install --legacy-peer-deps
in root of projectnpm install
in examples/angular-appnpm start
in one command prompt terminal, keep this terminal runningnpx jest
in another command prompt terminalIf you're talking about using SafeTest in you own project and you're using npm install safetest
then it should be available via this export in package.json
You can see the code on the npm page
Oh looking at over the issue again, on windows you need to change
OPT_URL=${OPT_URL:-http://localhost:4200}
to
OPT_URL=http://localhost:4200
The ${OPT_URL:-http://localhost:4200}
only works on nix based systems
Thanks a lot for the explanations, it works regarding the target URL like a charm, setting the url in the setup file is perfect.
Nonetheless, I still have the issue where I can't import the right lib, which is strange cause as you mentionned below, we see that is available, here is what I have when I want to import :
By choosing safetest/lib/ng, by running my tests it gives the following error :
Effectively, I'm installing it in a project to fully test it :)
Hmm, this is an issue with your tooling not following the exports field, that's why there's all these top level files like /react.js just to point to the lib one. I'll need to push a release with an ng file as well. For now you should be able to // @ts-ignore
it
I just published 0.1.12 release which has this file, can you give that a try?
That's solved it, thanks a lot for your help and guiding @kolodny
import { makeSafetestBed } from 'safetest/ng';
Throws this error : TS2307: Cannot find module safetest/ng or its corresponding type declarations
Where does this module come from and how to fix this issue ?
npm run safetest
, I get :I'm running it on localhost obviously, Angular 17. My script :
"safetest": "cross-env OPT_URL=${OPT_URL:-http://localhost:4200} jest --runInBand --bail=5 --testMatch '**/*.safetest.ts' --setupFilesAfterEnv ./setup-safetest.js --testTimeout=30000"