jxson / front-matter

Extract YAML front matter from strings
MIT License
675 stars 76 forks source link

test: add typescript declaration test #68

Closed tyankatsu0105 closed 4 years ago

tyankatsu0105 commented 4 years ago

re https://github.com/jxson/front-matter/issues/61#issuecomment-629298885

tyankatsu0105 commented 4 years ago

@jxson @kubosho How about this?

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling c61d45ed92ddd87c20a393f5f285723d841acc52 on tyankatsu0105:test/add-declaration-test into eaf33a549bf81fb26e95ad4ee41afe28e67f1334 on jxson:master.

jxson commented 4 years ago

Overall looks pretty good, check-dts seems like a nice tool.

A couple questions:

tyankatsu0105 commented 4 years ago

@jxson

In the test/index.types.ts file there are no assertions, is that common for positive check-dts tests?

See: https://github.com/ai/nanoevents/blob/master/test/types.ts check-dts tests with comments whether occurred types error. (I want to use assert like jest or chai....)

There are also calls to console.log in the file, usually calling loggers in tests is undesirable. Are these intentional? (note that running the tests locally I don't see any log output)

For avoiding this ts error.

jxson commented 4 years ago

Okay great,

I just merged #67 which changes the signature of the exported function to fm(string, { allowUnsafe: false }). Could you sync your PR with master and update the type definitions and the new tests to match?

tyankatsu0105 commented 4 years ago

OK. I'll try ;)

tyankatsu0105 commented 4 years ago

@jxson I added the type options to fm. Also, I updated tests :)

jxson commented 4 years ago

Awesome, thanks for this. Sorry for the late reply, I had a long weekend of no computers ;)

I'll merge and publish this later today...

On Sat, May 23, 2020 at 7:27 AM tyankatsu notifications@github.com wrote:

@jxson https://github.com/jxson I added the type options to fm. Also, I updated tests :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jxson/front-matter/pull/68#issuecomment-633064344, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAACV4PIV4DTKTZUNDJAVRDRS7MMBANCNFSM4NC3UITA .

tyankatsu0105 commented 4 years ago

Take it easy 😄

jxson commented 4 years ago

Published as front-matter@4.0.1