Cypress index.js不会向测试文件公开方法和常量

Cypress index.js不会向测试文件公开方法和常量,cypress,Cypress,声明文件将像这样运行 <!-- bundled support file --> <script src="support/index.js"></script> <!-- bundled spec file --> <script src="integration/spec-a.js"></script> 问题在于index.js中有一些常量,但在spec-a.js中无法访问

声明文件将像这样运行

<!-- bundled support file -->
<script src="support/index.js"></script>
<!-- bundled spec file -->
<script src="integration/spec-a.js"></script>

问题在于index.js中有一些常量,但在spec-a.js中无法访问

我认为模块将文件的变量封装到自己的作用域中不会有问题,因为index.js的目的是设置全局配置,并且文件以src=脚本的形式加载