There's no good test. Otherwise, that would be the interview process.
Usually, it is just others' opinions of you. You might try a bunch of different jobs, be bad at them, but eventually find a great fit where everyone respects your work. Those prior opinions don't really matter now, do they?
One of the other key problems why it's difficult to answer is that the standards of development change very rapidly. You'd likely find the same questions in the spirit of "what makes a good punch card developer?" when those systems were around. There were probably a lot of interviewers with a lot of heuristics to hire the best, but those specifics don't matter any more either.
And sometimes, it comes down to simply marketing yourself well or having good salesmanship or playing office politics.
It is an excellent question. Having an answer to it would be very valuable and I spent a lot of time thinking about it but found no conclusive answer. Sadly.
First of all, I do not condemn people trying to do their best to legally provide for themselves even if it means trying to get the job that they are not qualified for (as long as it is legal). Just look at our politicians. I might take an issue if you are straight lying about facts and your abilities.
But at the same time I think I am fully justified to politely refuse to be the sucker that hires them.
One reason you may want to know if you are qualified for the job is if you want to stay there for longer. Sometimes for some people stability over long term pays more than constantly getting jobs that are just above your level.
Keep a personal resume doc going. List out the projects you’ve done, how you contributed, who benefitted, and quantify the benefit if you can.
Keeping a running list like this is how you can build confidence and see a bigger picture to your career. I did this recently at my current job as I was approaching burnout. It helped me reset that tailspin.
How do I know if I'm good? Like, before applying, so that I don't have to waste anybody's time.