- 可以使用👉测试网址
- 点击
page
下的index.html
在浏览器下查看即可
- 如果改动了
index.html
,将更新后的代码放到test_production
,修改引入路径
-
将功能代码放置于
main
文件夹下,以功能分组 -
在写功能代码时
// 定义函数 function test(){ } // 暴露函数 module.exports = test;
-
在
spec
下写测试代码,首先引入函数,格式如下const 函数名 = require('../main/实现文件.js);
-
运行测试
npm test
- main-spec.js