Github user Hanks10100 commented on the issue:
https://github.com/apache/incubator-weex/pull/126
That because the node.js environment doesn't have the `callNative` method.
You should mock that method in tests.
1. Import `sinon`, which is already in the `devDependencies` of
package.json.
```js
import sinon from 'sinon'
```
2. Spy the `callNative` API.
```js
describe('vanilla test', () => {
// In case there did has callNative in the environment
const originalCallNative = global.callNative
const callNativeSpy = sinon.spy()
before(() => {
global.callNative = callNativeSpy
})
afterEach(() => {
callNativeSpy.reset()
})
after(() => {
global.callNative = originalCallNative
})
it('...', () => {})
})
```
Moreover, you can use `callNativeSpy` to check the parameter of call native
tasks.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---