myrne / performance-now

Implements performance.now (based on process.hrtime).
MIT License
162 stars 26 forks source link

Test typescript type definitions. #9

Closed rictic closed 7 years ago

rictic commented 7 years ago

Adds a typescript file that uses the type definitions, and adds the typescript compiler to the npm test command.

rictic commented 7 years ago

To address the concerns about testing in #8

myrne commented 7 years ago

Thanks!

It surprised me that you were compiling the src/index.d.ts explicitly. As this file is referenced inside the package.json, this didn't seem necessary. I changed test-typings.ts so that it requires the package root. Typescript correctly finds the type definition file by itself. I know because test-typings.ts fails to compile when I change the type to string.

rictic commented 7 years ago

Oh cool, I didn't know that would work. I guess it sees the package.json? That makes sense. Much nicer!