Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

📦 Change typings-tester for tsd #24

Merged
merged 10 commits into from
May 1, 2020
Merged

📦 Change typings-tester for tsd #24

merged 10 commits into from
May 1, 2020

Conversation

Yurickh
Copy link
Owner

@Yurickh Yurickh commented May 1, 2020

Removing typings-tester in favour of tsd

tsd proved to be useful to our needs in gutenpress, but also we've lost some of the power we had by just defining comments, as we can't combine multiple assertions in the same expression.
e.g.

// before
wrap(wrapper, [
    get('/correct', correctHandler),
    // typings:expect-error
    post('/error', errorHandler),
])

// now
wrap(wrapper, [get('/correct', correctHandler)])
expectError(wrap(wrapper, [post('/error', errorHandler)]))

This is the case since expectError doesn't return whatever it gets, rather it returns void :T
Hence this issue closes #22, but we might want to keep an eye out for better suiting alternatives.

Improving types of fromEntries and mapObejct

As an extra, we're improving the types for fromEntries in @gutenpress/helpers by removing the need to explicitly define the return type, and by being smarter about the returned values. Consequently, we also fix mapObject's types as described in #21, so this issue also closes #21.

@Yurickh Yurickh merged commit dc8cd3b into master May 1, 2020
@Yurickh Yurickh deleted the adopt-tsd branch May 1, 2020 11:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider moving type tests to dts [@gutenpress/helpers] Improve types of mapObject
1 participant