glenjamin / skin-deep

Test assertion helpers for use with React's shallowRender test utils
MIT License
200 stars 40 forks source link

Add TypeScript definitons #83

Closed janslow closed 7 years ago

janslow commented 7 years ago

Adds type definitions to assist TypeScript developers.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 46e7c5ca78ad355d037ca57bbd21ada9fc1f56f4 on janslow:feature/typescript-definitions into aee90f2d2234c62e8b43d3d939b1c853328f8f22 on glenjamin:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 3ff39e279f8078c99d50d198512a4ab77c8f3cbb on janslow:feature/typescript-definitions into aee90f2d2234c62e8b43d3d939b1c853328f8f22 on glenjamin:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 3ff39e279f8078c99d50d198512a4ab77c8f3cbb on janslow:feature/typescript-definitions into aee90f2d2234c62e8b43d3d939b1c853328f8f22 on glenjamin:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 3ff39e279f8078c99d50d198512a4ab77c8f3cbb on janslow:feature/typescript-definitions into aee90f2d2234c62e8b43d3d939b1c853328f8f22 on glenjamin:master.

glenjamin commented 7 years ago

Looks like the test failures are unrelated to this change, will take a look into that when I get a moment.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling fe88392a123679080a092597a848d62177a26b13 on janslow:feature/typescript-definitions into aee90f2d2234c62e8b43d3d939b1c853328f8f22 on glenjamin:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling fe88392a123679080a092597a848d62177a26b13 on janslow:feature/typescript-definitions into aee90f2d2234c62e8b43d3d939b1c853328f8f22 on glenjamin:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling fe88392a123679080a092597a848d62177a26b13 on janslow:feature/typescript-definitions into aee90f2d2234c62e8b43d3d939b1c853328f8f22 on glenjamin:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling fe88392a123679080a092597a848d62177a26b13 on janslow:feature/typescript-definitions into aee90f2d2234c62e8b43d3d939b1c853328f8f22 on glenjamin:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling fe88392a123679080a092597a848d62177a26b13 on janslow:feature/typescript-definitions into aee90f2d2234c62e8b43d3d939b1c853328f8f22 on glenjamin:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling fe88392a123679080a092597a848d62177a26b13 on janslow:feature/typescript-definitions into aee90f2d2234c62e8b43d3d939b1c853328f8f22 on glenjamin:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 39bbf9f04cd1f3cd8998b2569bfde1389f2c4bac on janslow:feature/typescript-definitions into aee90f2d2234c62e8b43d3d939b1c853328f8f22 on glenjamin:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 39bbf9f04cd1f3cd8998b2569bfde1389f2c4bac on janslow:feature/typescript-definitions into aee90f2d2234c62e8b43d3d939b1c853328f8f22 on glenjamin:master.

janslow commented 7 years ago

Sorry, I hadn't noticed the comment about peerDependencies, I've removed that (and the @types/react for consistency). The @types/react is the typescript definitions of React, so that the types of a React element and component can be used.

I've also restricted the context and props types, per your suggestions.

I believe I've also corrected the Selector/Matcher types. Selector can either be a string or a React component type and Matcher can either be an object (i.e., a subset of component props) or a predicate which takes a react node.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 61703035d00b4360cf410d5b0dc6364d1e1e5dd8 on janslow:feature/typescript-definitions into aee90f2d2234c62e8b43d3d939b1c853328f8f22 on glenjamin:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 61703035d00b4360cf410d5b0dc6364d1e1e5dd8 on janslow:feature/typescript-definitions into aee90f2d2234c62e8b43d3d939b1c853328f8f22 on glenjamin:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 61703035d00b4360cf410d5b0dc6364d1e1e5dd8 on janslow:feature/typescript-definitions into aee90f2d2234c62e8b43d3d939b1c853328f8f22 on glenjamin:master.

janslow commented 7 years ago

Also, out of interest, what's your reason against using peer dependencies for React? Surely "react": ">= 0.14.0" provides enough flexibility for users, as it adds allows all React versions above/including the supported 0.14.

glenjamin commented 7 years ago

@janslow ">= 0.14" makes a promise that isn't really true - it's claiming to work with any new version, but I have no idea if we'll work with the next version.

For that reason I just leave it out.

glenjamin commented 7 years ago

Released in v1.0.0-alpha2

janslow commented 7 years ago

That's great, thanks.