weui-miniprogram icon indicating copy to clipboard operation
weui-miniprogram copied to clipboard

npm test TypeError: Cannot read property 'attach' of undefined

Open MakerGYT opened this issue 5 years ago • 0 comments

未作任何修改,执行npm test报错如下:

 PASS  test/wx.test.js
 FAIL  test/index.test.js
  ● render

    TypeError: Cannot read property 'attach' of undefined

       6 | 
       7 |   const parent = document.createElement('parent-wrapper')
    >  8 |   component.attach(parent)
         |             ^
       9 | 
      10 |   expect(_.match(component.dom, '<wx-view class="comp--index comp--other">index.test.properties-false</wx-view>')).toBe(true)
      11 | 

      at _callee$ (test/index.test.js:8:13)
      at tryCatch (node_modules/regenerator-runtime/runtime.js:62:40)
      at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:296:22)
      at Generator.prototype.(anonymous function) [as next] (node_modules/regenerator-runtime/runtime.js:114:21)
      at step (test/index.test.js:3:191)
      at test/index.test.js:3:437
      at Object.<anonymous> (test/index.test.js:3:99)

Test Suites: 1 failed, 1 passed, 2 total
Tests:       1 failed, 2 passed, 3 total
Snapshots:   0 total
Time:        3.847s
npm ERR! Test failed.  See above for more details.

MakerGYT avatar Jan 10 '20 12:01 MakerGYT