whymarrh / hypercycle

A Cycle.js shim for hyperx
ISC License
4 stars 0 forks source link

Weird error running tests #20

Closed whymarrh closed 7 years ago

whymarrh commented 7 years ago

On a fresh clone, I ran into an error running the tests (npm i && npm t):

npm WARN deprecated @cycle/base@4.3.0: no longer used. see release notes for Cycle Unified
npm WARN deprecated @cycle/xstream-adapter@3.1.0: no longer supported. see release notes for Cycle Unified
hypercycle@4.0.0 /Users/w/Projects/hypercycle
├── @cycle/base@4.3.0 
├─┬ @cycle/dom@14.3.0 
│ ├── @cycle/xstream-adapter@3.1.0 
│ ├─┬ es6-map@0.1.4 
│ │ ├── d@0.1.1 
│ │ ├── es5-ext@0.10.12 
│ │ ├── es6-iterator@2.0.0 
│ │ ├── es6-set@0.1.4 
│ │ ├── es6-symbol@3.1.0 
│ │ └── event-emitter@0.3.4 
│ ├── matches-selector@1.0.0 
│ └─┬ snabbdom-selector@0.4.0 
│   ├── browser-split@0.0.1 
│   └── cssauron@1.4.0 
├── @types/node@7.0.5 
├── @types/tape@4.2.29 
├─┬ hyperx@2.0.5 
│ └── hyperscript-attribute-to-property@1.0.0 
├── snabbdom@0.6.5 
├─┬ snabbdom-to-html@3.1.1 
│ ├── lodash.escape@4.0.1 
│ ├── lodash.forown@4.4.0 
│ ├── lodash.kebabcase@4.1.1 
│ ├── lodash.remove@4.7.0 
│ ├── lodash.uniq@4.5.0 
│ ├── object-assign@4.1.1 
│ └── parse-sel@1.0.0 
├─┬ tap-list@1.0.1 
│ ├─┬ chalk@1.1.3 
│ │ ├── ansi-styles@2.2.1 
│ │ ├── escape-string-regexp@1.0.5 
│ │ ├─┬ has-ansi@2.0.0 
│ │ │ └── ansi-regex@2.1.1 
│ │ ├── strip-ansi@3.0.1 
│ │ └── supports-color@2.0.0 
│ ├── duplexer@0.1.1 
│ ├── figures@2.0.0 
│ ├── has-flag@2.0.0 
│ ├── lodash.groupby@4.6.0 
│ ├── lodash.trimstart@4.5.1 
│ ├── pluralize@3.1.0 
│ ├─┬ tap-out@1.4.2 
│ │ ├── re-emitter@1.1.3 
│ │ ├─┬ readable-stream@2.2.3 
│ │ │ ├── buffer-shims@1.0.0 
│ │ │ ├── core-util-is@1.0.2 
│ │ │ ├── isarray@1.0.0 
│ │ │ ├── process-nextick-args@1.0.7 
│ │ │ ├── string_decoder@0.10.31 
│ │ │ └── util-deprecate@1.0.2 
│ │ ├── split@1.0.0 
│ │ └── trim@0.0.1 
│ └─┬ through2@2.0.3 
│   └── xtend@4.0.1 
├─┬ tape@4.6.3 
│ ├── deep-equal@1.0.1 
│ ├── defined@1.0.0 
│ ├─┬ for-each@0.3.2 
│ │ └── is-function@1.0.1 
│ ├── function-bind@1.1.0 
│ ├─┬ glob@7.1.1 
│ │ ├── fs.realpath@1.0.0 
│ │ ├─┬ inflight@1.0.6 
│ │ │ └── wrappy@1.0.2 
│ │ ├─┬ minimatch@3.0.3 
│ │ │ └─┬ brace-expansion@1.1.6 
│ │ │   ├── balanced-match@0.4.2 
│ │ │   └── concat-map@0.0.1 
│ │ ├── once@1.4.0 
│ │ └── path-is-absolute@1.0.1 
│ ├── has@1.0.1 
│ ├── inherits@2.0.3 
│ ├── minimist@1.2.0 
│ ├── object-inspect@1.2.1 
│ ├── resolve@1.1.7 
│ ├── resumer@0.0.0 
│ ├─┬ string.prototype.trim@1.1.2 
│ │ ├─┬ define-properties@1.1.2 
│ │ │ ├── foreach@2.0.5 
│ │ │ └── object-keys@1.0.11 
│ │ └─┬ es-abstract@1.7.0 
│ │   ├─┬ es-to-primitive@1.1.1 
│ │   │ ├── is-date-object@1.0.1 
│ │   │ └── is-symbol@1.0.1 
│ │   ├── is-callable@1.1.3 
│ │   └── is-regex@1.0.4 
│ └── through@2.3.8 
├── typescript@2.2.1 
└─┬ xstream@10.3.0 
  └── symbol-observable@1.0.4 

> hypercycle@4.0.0 test /Users/w/Projects/hypercycle
> npm run build && tape test/**/*.js | tap-list

> hypercycle@4.0.0 build /Users/w/Projects/hypercycle
> tsc --project .

/Users/w/Projects/hypercycle/node_modules/@cycle/dom/lib/hyperscript.js:60
    return vnode(sel, data, children, text, undefined);
           ^

TypeError: vnode is not a function
    at Object.h (/Users/w/Projects/hypercycle/node_modules/@cycle/dom/lib/hyperscript.js:60:12)
    at hyperx (/Users/w/Projects/hypercycle/src/index.js:22:18)
    at /Users/w/Projects/hypercycle/node_modules/hyperscript-attribute-to-property/index.js:17:12
    at Object.html (/Users/w/Projects/hypercycle/node_modules/hyperx/index.js:44:45)
    at Test.test (/Users/w/Projects/hypercycle/test/index.js:8:31)
    at Test.bound [as _cb] (/Users/w/Projects/hypercycle/node_modules/tape/lib/test.js:66:32)
    at Test.run (/Users/w/Projects/hypercycle/node_modules/tape/lib/test.js:85:10)
    at Test.bound [as run] (/Users/w/Projects/hypercycle/node_modules/tape/lib/test.js:66:32)
    at Immediate.next (/Users/w/Projects/hypercycle/node_modules/tape/lib/results.js:71:15)
    at runCallback (timers.js:651:20)
✔  html does generate simple div

1 test (0 assertions)

Assuming it was an updated snabbdom issue, I tried to isolate a particular package, but it seems to work fine when I install each package version directly:

npm i '@cycle/base@4.3.0' '@cycle/dom@14.3.0' 'hyperx@2.0.5' 'xstream@10.0.0' '@types/node@7.0.5' '@types/tape@4.2.29' 'snabbdom@0.6.4' 'snabbdom-to-html@3.1.0' 'tap-list@1.0.1' 'tape@4.6.3' 'typescript@2.1.6'
npm t
npm WARN deprecated @cycle/base@4.3.0: no longer used. see release notes for Cycle Unified
npm WARN deprecated @cycle/xstream-adapter@3.1.0: no longer supported. see release notes for Cycle Unified
hypercycle@4.0.0 /Users/w/Projects/hypercycle
├── @cycle/base@4.3.0 
├─┬ @cycle/dom@14.3.0 
│ ├── @cycle/xstream-adapter@3.1.0 
│ ├─┬ es6-map@0.1.4 
│ │ ├── d@0.1.1 
│ │ ├── es5-ext@0.10.12 
│ │ ├── es6-iterator@2.0.0 
│ │ ├── es6-set@0.1.4 
│ │ ├── es6-symbol@3.1.0 
│ │ └── event-emitter@0.3.4 
│ ├── matches-selector@1.0.0 
│ ├── snabbdom@0.5.0 
│ ├─┬ snabbdom-selector@0.4.0 
│ │ └── cssauron@1.4.0 
│ └─┬ snabbdom-to-html@2.1.3 
│   ├── browser-split@0.0.1 
│   ├─┬ lodash.escape@3.2.0 
│   │ └── lodash._root@3.0.1 
│   ├─┬ lodash.forown@3.0.2 
│   │ ├── lodash._basefor@3.0.3 
│   │ ├── lodash._bindcallback@3.0.1 
│   │ └─┬ lodash.keys@3.1.2 
│   │   ├── lodash._getnative@3.9.1 
│   │   ├── lodash.isarguments@3.1.0 
│   │   └── lodash.isarray@3.0.4 
│   ├─┬ lodash.kebabcase@3.1.1 
│   │ ├── lodash.deburr@3.2.0 
│   │ └── lodash.words@3.2.0 
│   └─┬ lodash.union@3.1.0 
│     ├── lodash._baseflatten@3.1.4 
│     ├─┬ lodash._baseuniq@3.0.3 
│     │ ├── lodash._baseindexof@3.1.0 
│     │ ├── lodash._cacheindexof@3.0.2 
│     │ └── lodash._createcache@3.1.2 
│     └── lodash.restparam@3.6.1 
├── @types/node@7.0.5 
├── @types/tape@4.2.29 
├─┬ hyperx@2.0.5 
│ └── hyperscript-attribute-to-property@1.0.0 
├── snabbdom@0.6.4 
├─┬ snabbdom-to-html@3.1.0 
│ ├── lodash.escape@4.0.1 
│ ├── lodash.forown@4.4.0 
│ ├── lodash.kebabcase@4.1.1 
│ ├── lodash.remove@4.7.0 
│ ├── lodash.uniq@4.5.0 
│ ├── object-assign@4.1.1 
│ └── parse-sel@1.0.0 
├─┬ tap-list@1.0.1 
│ ├─┬ chalk@1.1.3 
│ │ ├── ansi-styles@2.2.1 
│ │ ├── escape-string-regexp@1.0.5 
│ │ ├─┬ has-ansi@2.0.0 
│ │ │ └── ansi-regex@2.1.1 
│ │ ├── strip-ansi@3.0.1 
│ │ └── supports-color@2.0.0 
│ ├── duplexer@0.1.1 
│ ├── figures@2.0.0 
│ ├── has-flag@2.0.0 
│ ├── lodash.groupby@4.6.0 
│ ├── lodash.trimstart@4.5.1 
│ ├── pluralize@3.1.0 
│ ├─┬ tap-out@1.4.2 
│ │ ├── re-emitter@1.1.3 
│ │ ├─┬ readable-stream@2.2.3 
│ │ │ ├── buffer-shims@1.0.0 
│ │ │ ├── core-util-is@1.0.2 
│ │ │ ├── isarray@1.0.0 
│ │ │ ├── process-nextick-args@1.0.7 
│ │ │ ├── string_decoder@0.10.31 
│ │ │ └── util-deprecate@1.0.2 
│ │ ├── split@1.0.0 
│ │ └── trim@0.0.1 
│ └─┬ through2@2.0.3 
│   └── xtend@4.0.1 
├─┬ tape@4.6.3 
│ ├── deep-equal@1.0.1 
│ ├── defined@1.0.0 
│ ├─┬ for-each@0.3.2 
│ │ └── is-function@1.0.1 
│ ├── function-bind@1.1.0 
│ ├─┬ glob@7.1.1 
│ │ ├── fs.realpath@1.0.0 
│ │ ├─┬ inflight@1.0.6 
│ │ │ └── wrappy@1.0.2 
│ │ ├─┬ minimatch@3.0.3 
│ │ │ └─┬ brace-expansion@1.1.6 
│ │ │   ├── balanced-match@0.4.2 
│ │ │   └── concat-map@0.0.1 
│ │ ├── once@1.4.0 
│ │ └── path-is-absolute@1.0.1 
│ ├── has@1.0.1 
│ ├── inherits@2.0.3 
│ ├── minimist@1.2.0 
│ ├── object-inspect@1.2.1 
│ ├── resolve@1.1.7 
│ ├── resumer@0.0.0 
│ ├─┬ string.prototype.trim@1.1.2 
│ │ ├─┬ define-properties@1.1.2 
│ │ │ ├── foreach@2.0.5 
│ │ │ └── object-keys@1.0.11 
│ │ └─┬ es-abstract@1.7.0 
│ │   ├─┬ es-to-primitive@1.1.1 
│ │   │ ├── is-date-object@1.0.1 
│ │   │ └── is-symbol@1.0.1 
│ │   ├── is-callable@1.1.3 
│ │   └── is-regex@1.0.4 
│ └── through@2.3.8 
├── typescript@2.1.6 
└─┬ xstream@10.0.0 
  └── symbol-observable@1.0.4 

> hypercycle@4.0.0 test /Users/w/Projects/hypercycle
> npm run build && tape test/**/*.js | tap-list

> hypercycle@4.0.0 build /Users/w/Projects/hypercycle
> tsc --project .

✔  html does generate simple div
✔  html does generate simple div with variable
✔  html does generate div with class name
✔  html does generate div with data attr
✔  html does generate div with style attr
✔  html does generate nested div
✔  html does generate child from nested vdom
✔  html does generate children from nested array of numbers
✔  html does generate children from nested array of vdom
✔  html does generate children from text and nested array of vdom
✔  html does generate children from nested array of vdom and text
✔  html does generate children from text, nested array of vdom, and text
✔  html does generate children from text, complex nested array of vdom, and text
✔  html does generate children from text, complex nested array of vdom, and text, keeping parent attrs
✔  html does generate children from text, complex nested array of vdom, and text, keeping attrs

15 tests (15 assertions)
whymarrh commented 7 years ago

The list of installed packages after npm i:

hypercycle@4.0.0 /Users/w/Projects/hypercycle
├── @cycle/base@4.3.0
├─┬ @cycle/dom@14.3.0
│ ├── @cycle/xstream-adapter@3.1.0
│ ├─┬ es6-map@0.1.4
│ │ ├── d@0.1.1
│ │ ├── es5-ext@0.10.12
│ │ ├── es6-iterator@2.0.0
│ │ ├── es6-set@0.1.4
│ │ ├── es6-symbol@3.1.0
│ │ └── event-emitter@0.3.4
│ ├── matches-selector@1.0.0
│ ├── UNMET DEPENDENCY snabbdom@0.5.0
│ ├─┬ snabbdom-selector@0.4.0
│ │ ├── browser-split@0.0.1
│ │ └── cssauron@1.4.0
│ └── UNMET DEPENDENCY snabbdom-to-html@^2.0.1
├── @types/node@7.0.5
├── @types/tape@4.2.29
├─┬ hyperx@2.0.5
│ └── hyperscript-attribute-to-property@1.0.0
├── snabbdom@0.6.5
├─┬ snabbdom-to-html@3.1.1
│ ├── lodash.escape@4.0.1
│ ├── lodash.forown@4.4.0
│ ├── lodash.kebabcase@4.1.1
│ ├── lodash.remove@4.7.0
│ ├── lodash.uniq@4.5.0
│ ├── object-assign@4.1.1
│ └── parse-sel@1.0.0
├─┬ tap-list@1.0.1
│ ├─┬ chalk@1.1.3
│ │ ├── ansi-styles@2.2.1
│ │ ├── escape-string-regexp@1.0.5
│ │ ├─┬ has-ansi@2.0.0
│ │ │ └── ansi-regex@2.1.1
│ │ ├── strip-ansi@3.0.1
│ │ └── supports-color@2.0.0
│ ├── duplexer@0.1.1
│ ├── figures@2.0.0
│ ├── has-flag@2.0.0
│ ├── lodash.groupby@4.6.0
│ ├── lodash.trimstart@4.5.1
│ ├── pluralize@3.1.0
│ ├─┬ tap-out@1.4.2
│ │ ├── re-emitter@1.1.3
│ │ ├─┬ readable-stream@2.2.3
│ │ │ ├── buffer-shims@1.0.0
│ │ │ ├── core-util-is@1.0.2
│ │ │ ├── isarray@1.0.0
│ │ │ ├── process-nextick-args@1.0.7
│ │ │ ├── string_decoder@0.10.31
│ │ │ └── util-deprecate@1.0.2
│ │ ├── split@1.0.0
│ │ └── trim@0.0.1
│ └─┬ through2@2.0.3
│   └── xtend@4.0.1
├─┬ tape@4.6.3
│ ├── deep-equal@1.0.1
│ ├── defined@1.0.0
│ ├─┬ for-each@0.3.2
│ │ └── is-function@1.0.1
│ ├── function-bind@1.1.0
│ ├─┬ glob@7.1.1
│ │ ├── fs.realpath@1.0.0
│ │ ├─┬ inflight@1.0.6
│ │ │ └── wrappy@1.0.2
│ │ ├─┬ minimatch@3.0.3
│ │ │ └─┬ brace-expansion@1.1.6
│ │ │   ├── balanced-match@0.4.2
│ │ │   └── concat-map@0.0.1
│ │ ├── once@1.4.0
│ │ └── path-is-absolute@1.0.1
│ ├── has@1.0.1
│ ├── inherits@2.0.3
│ ├── minimist@1.2.0
│ ├── object-inspect@1.2.1
│ ├── resolve@1.1.7
│ ├── resumer@0.0.0
│ ├─┬ string.prototype.trim@1.1.2
│ │ ├─┬ define-properties@1.1.2
│ │ │ ├── foreach@2.0.5
│ │ │ └── object-keys@1.0.11
│ │ └─┬ es-abstract@1.7.0
│ │   ├─┬ es-to-primitive@1.1.1
│ │   │ ├── is-date-object@1.0.1
│ │   │ └── is-symbol@1.0.1
│ │   ├── is-callable@1.1.3
│ │   └── is-regex@1.0.4
│ └── through@2.3.8
├── typescript@2.2.1
└─┬ xstream@10.3.0
  └── symbol-observable@1.0.4

npm ERR! missing: snabbdom@0.5.0, required by @cycle/dom@14.3.0
npm ERR! missing: snabbdom-to-html@^2.0.1, required by @cycle/dom@14.3.0

The list of installed packages after installing each dependency manually:

hypercycle@4.0.0 /Users/w/Projects/hypercycle
├── @cycle/base@4.3.0
├─┬ @cycle/dom@14.3.0
│ ├── @cycle/xstream-adapter@3.1.0
│ ├─┬ es6-map@0.1.4
│ │ ├── d@0.1.1
│ │ ├── es5-ext@0.10.12
│ │ ├── es6-iterator@2.0.0
│ │ ├── es6-set@0.1.4
│ │ ├── es6-symbol@3.1.0
│ │ └── event-emitter@0.3.4
│ ├── matches-selector@1.0.0
│ ├── snabbdom@0.5.0
│ ├─┬ snabbdom-selector@0.4.0
│ │ └── cssauron@1.4.0
│ └─┬ snabbdom-to-html@2.1.3
│   ├── browser-split@0.0.1
│   ├─┬ lodash.escape@3.2.0
│   │ └── lodash._root@3.0.1
│   ├─┬ lodash.forown@3.0.2
│   │ ├── lodash._basefor@3.0.3
│   │ ├── lodash._bindcallback@3.0.1
│   │ └─┬ lodash.keys@3.1.2
│   │   ├── lodash._getnative@3.9.1
│   │   ├── lodash.isarguments@3.1.0
│   │   └── lodash.isarray@3.0.4
│   ├─┬ lodash.kebabcase@3.1.1
│   │ ├── lodash.deburr@3.2.0
│   │ └── lodash.words@3.2.0
│   └─┬ lodash.union@3.1.0
│     ├── lodash._baseflatten@3.1.4
│     ├─┬ lodash._baseuniq@3.0.3
│     │ ├── lodash._baseindexof@3.1.0
│     │ ├── lodash._cacheindexof@3.0.2
│     │ └── lodash._createcache@3.1.2
│     └── lodash.restparam@3.6.1
├── @types/node@7.0.5
├── @types/tape@4.2.29
├─┬ hyperx@2.0.5
│ └── hyperscript-attribute-to-property@1.0.0
├── snabbdom@0.6.4
├─┬ snabbdom-to-html@3.1.0
│ ├── lodash.escape@4.0.1
│ ├── lodash.forown@4.4.0
│ ├── lodash.kebabcase@4.1.1
│ ├── lodash.remove@4.7.0
│ ├── lodash.uniq@4.5.0
│ ├── object-assign@4.1.1
│ └── parse-sel@1.0.0
├─┬ tap-list@1.0.1
│ ├─┬ chalk@1.1.3
│ │ ├── ansi-styles@2.2.1
│ │ ├── escape-string-regexp@1.0.5
│ │ ├─┬ has-ansi@2.0.0
│ │ │ └── ansi-regex@2.1.1
│ │ ├── strip-ansi@3.0.1
│ │ └── supports-color@2.0.0
│ ├── duplexer@0.1.1
│ ├── figures@2.0.0
│ ├── has-flag@2.0.0
│ ├── lodash.groupby@4.6.0
│ ├── lodash.trimstart@4.5.1
│ ├── pluralize@3.1.0
│ ├─┬ tap-out@1.4.2
│ │ ├── re-emitter@1.1.3
│ │ ├─┬ readable-stream@2.2.3
│ │ │ ├── buffer-shims@1.0.0
│ │ │ ├── core-util-is@1.0.2
│ │ │ ├── isarray@1.0.0
│ │ │ ├── process-nextick-args@1.0.7
│ │ │ ├── string_decoder@0.10.31
│ │ │ └── util-deprecate@1.0.2
│ │ ├── split@1.0.0
│ │ └── trim@0.0.1
│ └─┬ through2@2.0.3
│   └── xtend@4.0.1
├─┬ tape@4.6.3
│ ├── deep-equal@1.0.1
│ ├── defined@1.0.0
│ ├─┬ for-each@0.3.2
│ │ └── is-function@1.0.1
│ ├── function-bind@1.1.0
│ ├─┬ glob@7.1.1
│ │ ├── fs.realpath@1.0.0
│ │ ├─┬ inflight@1.0.6
│ │ │ └── wrappy@1.0.2
│ │ ├─┬ minimatch@3.0.3
│ │ │ └─┬ brace-expansion@1.1.6
│ │ │   ├── balanced-match@0.4.2
│ │ │   └── concat-map@0.0.1
│ │ ├── once@1.4.0
│ │ └── path-is-absolute@1.0.1
│ ├── has@1.0.1
│ ├── inherits@2.0.3
│ ├── minimist@1.2.0
│ ├── object-inspect@1.2.1
│ ├── resolve@1.1.7
│ ├── resumer@0.0.0
│ ├─┬ string.prototype.trim@1.1.2
│ │ ├─┬ define-properties@1.1.2
│ │ │ ├── foreach@2.0.5
│ │ │ └── object-keys@1.0.11
│ │ └─┬ es-abstract@1.7.0
│ │   ├─┬ es-to-primitive@1.1.1
│ │   │ ├── is-date-object@1.0.1
│ │   │ └── is-symbol@1.0.1
│ │   ├── is-callable@1.1.3
│ │   └── is-regex@1.0.4
│ └── through@2.3.8
├── typescript@2.1.6
└─┬ xstream@10.0.0
  └── symbol-observable@1.0.4
whymarrh commented 7 years ago

Node.js version 6.10.0 and npm versions 3.10.10:

21:24:29 hypercycle (master=) $ node --version
v6.10.0
21:24:33 hypercycle (master=) $ npm --version
3.10.10
whymarrh commented 7 years ago

Upgrading to npm@latest (4.3.0) fixes this