fahad19 / proppy

Functional props composition for UI components (React.js & Vue.js)
https://proppyjs.com
MIT License
940 stars 27 forks source link

use ProppyContext's Provider for ProppyProvider (#35) and unit-tests for preact #38

Closed konsumer closed 6 years ago

konsumer commented 6 years ago

use ProppyContext's Provider for ProppyProvider

konsumer commented 6 years ago

I started out trying to resolve #35 , but my solution didn't work. In the process, I got test-parity with react, so I'm going to stop there for now.

konsumer commented 6 years ago

Seems good on both counts, after last commit. Tests pass & no context-warnings.

fahad19 commented 6 years ago

@konsumer: thanks for the PR! 🎉

Looked good from PR-level, but build is now failing on master :(

https://travis-ci.org/fahad19/proppy/builds/440019708

fahad19 commented 6 years ago

Build passing now. But still has warnings:

$ (cd ./packages/proppy-preact/ && npm test)

> proppy-preact@1.2.6 test /Users/FHeylaal/Repos/proppy/packages/proppy-preact
> ../../node_modules/.bin/jest --

 PASS  src/attach.spec.tsx
  ● Console

    console.warn node_modules/preact-context/dist/cjs/context.js:32
      Consumer used without a Provider
    console.warn node_modules/preact-context/dist/cjs/context.js:32
      Consumer used without a Provider
    console.warn node_modules/preact-context/dist/cjs/context.js:32
      Consumer used without a Provider
    console.warn node_modules/preact-context/dist/cjs/context.js:32
      Consumer used without a Provider
    console.warn node_modules/preact-context/dist/cjs/context.js:32
      Consumer used without a Provider

 PASS  src/index.spec.ts

Test Suites: 2 passed, 2 total
Tests:       7 passed, 7 total
Snapshots:   0 total
Time:        1.85s, estimated 2s
Ran all test suites.
konsumer commented 6 years ago

Hmm, yeh, I think I need to take another look. I'm not quite sure I'm even testing the right things. I tried to pattern it after the react tests, but I think context just works a bit different with preact. I will have another look, soon.