Consider:
command1 | command2
Is the output of command1 used as standard input of command2 or as command line arguments to command2?
<
It's used as the stdin.
Try:
grep "hehe" - $(cat test.sh)
That might be wrong; I can't test it out on this computer. If you do it without the pipe like you tried, grep treats the last argument as a filename, ie, looks for a file called [contents of test.sh]. If you pass it a - (or don't put a last argument), you tell it to use stdin as the file.
You can also just pass grep a file to scan through:
grep "hehe" test.sh
...but you seem to be asking more of a generalized bash question, not really a grep usage question, so that's probably not too helpful.