以下錯誤意味着什麼?我應該如何解決?TypeError:可能無法在嚴格模式函數或調用參數對象上訪問'caller','callee'和'arguments'屬性
$ npm test
> [email protected] test /Users/mishamoroshko/location-autosuggest
> mocha test --compilers js:babel/register
compareKeys()
should return -1
1) when first key is different
0 passing (301ms)
1 failing
1) compareKeys() should return -1 when first key is different:
TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them
at Context.<anonymous> (compare-keys/compare-keys.test.js:3:16)
以下是有關部分:
比較密鑰/比較-keys.test.js
1. 'use strict';
2.
3. import { expect } from 'chai';
的package.json
"scripts": {
"test": "mocha test --compilers js:babel/register"
}
。 babelrc
{
"stage": 0
}
mocha.opts
我沒有一個。
版本
- 巴貝爾:5.5.1
- 摩卡:2.2.5
- 柴:3.0.0
相似的問題stackoverflow.com/a/29130322/1909531這裏我發現解決方案排除:/ node_modules/ –
我對同一問題的回答https://stackoverflow.com/a/44666529/1114926 – Green