cannot use definition in .d.ts in spec files

11 Views Asked by At

the editor states error saying that the property I added to Request from express doesn't exist.

declare module Express {
  interface Request {
    idAnunciante?: string,
    locals?: any
  }
}

in my code is like this

somefile.spec.ts const request: Request

request.locals <<---locals doesn's exist

the declaration in somefile.ts is ok

request.locals <<-- ok
0

There are 0 best solutions below