This gist
is designed to explain how to configure a project where you have your test code separated from your codebase. The project file structure looks a bit like this:
project
├─┬ lib # could be src
│ ├── globals.d.ts # source code specific type declarations
│ └── index.ts
├─┬ tests