Open terminal and run command, from the command line [duplicate]

Your initial command, gnome-terminal -- 'echo "foo" | bash', attempts to run a program named literally echo␣"foo"␣|␣bash, which you most likely don't have on your system.

The correct syntax would be gnome-terminal -- sh -c 'echo "foo" | bash', but it would not help, unless you actually have an executable named foo. You can see that the syntax is correct by trying

gnome-terminal -- sh -c 'echo "date; sleep 2" | bash'

But this is just a very complicated way of saying

gnome-terminal -- bash -c 'date; sleep 2'

As for the intended command, it probably should be

gnome-terminal --tab -- bash -c 'ts-node /home/oleg/codes/typeaware/doc-gen/lang/typescript/api/src/.test/express.test.ts'