mocha
和chai
,但是由于import
关键字而无法运行。我想知道为什么,因为我读到Electron在大多数情况下都支持ES6甚至ES7。 这是我的依赖项:
"dependencies": {
"bootstrap": "^4.3.1",
"chai": "^4.2.0",
"mocha": "^6.2.2",
"react": "^16.9.0",
"react-bootstrap": "^1.0.0-beta.12",
"react-bootstrap-table-next": "^3.2.1",
"react-dom": "^16.9.0",
"react-scripts": "3.1.1",
"react-splitter-layout": "^4.0.0"
},
devDependency
。它不是在电子上运行。当您捆绑Electron的库时。仅依赖物会捆绑并进入电子,而不是devDependencies
。因此,在运行mocha时,chai测试您需要babel来支持es6语法。