测试
这个仓库为 JavaScript 和 C ++ 提供了linting 规则 - 以及单元和集成测试。 To learn more about Electron's coding style, please see the coding-style document.
为确保您的JavaScript符合Electron编码风格,请运行,它将针对Electron本身以及单元运行标准
测试。 如果您正在使用带有插件/插件系统的编辑器,则可能需要使用多个 之一来通知编码风格违规。
要确保您的C ++符合Electron编码风格,请运行运行脚本的npm run lint-cpp
。 我们建议您使用clang-format
并准备一个简短的教程。
这个版本库中没有太多的Python,但是它也受编码风格规则的支配。 npm run lint-py
将使用pylint
检查所有的Python。
单元测试
To run only specific tests matching a pattern, run npm run test — -g=PATTERN
, replacing the with a regex that matches the tests you would like to run. As an example: If you want to run only IPC tests, you would run npm run test — -g ipc
.
Some Windows 10 devices do not ship with the Meiryo font installed, which may cause a font fallback test to fail. To install Meiryo:
- Click Add a feature.