【文件属性】:
文件名称:meteor-fixtures:用于在测试中将数据库设置为一致状态的 Meteor 包
文件大小:2KB
文件格式:ZIP
更新时间:2021-06-05 06:46:54
JavaScript
用于在测试中将数据库设置为一致状态的 Meteor 包。
安装
1. 将此包添加到您的应用程序中。
meteor add ryne:fixtures
2. 在您的系统上安装 。 在大多数发行版中,这可能与 mongodb 包捆绑在一起。
3. 将函数添加到您的服务器专用 Meteor 方法中。
if ( Meteor . isServer ) {
typeof Fixtures !== 'undefined' && Meteor . methods ( Fixtures ) ;
}
可选:Git 忽略设备
为了 VCS 性能,您可能不想跟踪数据库转储。
echo ' tests/fixtures/ ' >> .gitignore
示例用法
保存装置
一旦您的数据库处于所需状态:
meteor shell
> Fixtures.saveFixtures ();
应用夹具
【文件预览】:
meteor-fixtures-master
----package.js(362B)
----fixtures.js(1KB)
----README.md(1KB)
----.versions(49B)