(b: Book)
| 143 | const book = await orm.em.findOneOrFail(Book, bookId, { populate: ['author'] }); |
| 144 | // even though `book.author` is typed as `LazyRef<Author>` in a bare `Book`, unref escapes the brand |
| 145 | function logAuthor(b: Book) { |
| 146 | return unref(b.author).name; |
| 147 | } |
| 148 | expect(logAuthor(book)).toBe('Stephen King'); |
| 149 | }); |
| 150 |