Add -g flag to runtests.sh to generate test data

Add functions to generate sample data for various formats
* Zotero Web API JSON (Zotero.Item::toJSON)
* CiteProc-JS JSON
* Export translator JSON
* Direct serialization of Zotero.Item fields
Add a way to load sample data into DB from JSON
Add tests for loading sample data into DB
Add tests for automatically generated data
This will help us make sure that field mappings and data formats don't change
This commit is contained in:
Aurimas Vinckevicius 2015-03-23 23:52:36 -05:00
parent 9d5d8b525a
commit 2ebce91ecf
5 changed files with 593 additions and 24 deletions

View file

@ -33,6 +33,9 @@ ZoteroUnit.prototype = {
handle:function(cmdLine) {
this.tests = cmdLine.handleFlagWithParam("test", false);
this.noquit = cmdLine.handleFlag("noquit", false);
this.makeTestData = cmdLine.handleFlag("makeTestData", false);
this.noquit = !this.makeTestData && this.noquit;
this.runTests = !this.makeTestData;
},
dump:function(x) {