/**
 * Parse and polish the screenshotter data in ss_data.yaml.
 *
 * This module is responsible for reading the file ss_data.yaml,
 * unify syntactic variations (like string vs. dict as test case body)
 * and provide common functionality (like a query string encoded version).
 * The export of this module is simply a dictionary of test cases.
 */

var fs = require("fs");
var jsyaml = require("js-yaml");
var querystring = require("querystring");

var dict = fs.readFileSync(require.resolve("./ss_data.yaml"));
dict = jsyaml.safeLoad(dict);
for (var key in dict) {
    var itm = dict[key];
    if (typeof itm === "string") {
        itm = dict[key] = { tex: itm };
    }
    itm.query = querystring.stringify(itm);
}
module.exports = dict;

@@ -443,16 +443,67 @@
 ing%22);%0A%0A
+var queryKeys = %5B%22tex%22, %22pre%22, %22post%22, %22display%22%5D;%0A
 var dict
@@ -557,16 +557,16 @@
 aml%22));%0A
-
 dict = j
@@ -717,16 +717,166 @@
 ;%0A    %7D%0A
+    var query = %7B%7D;%0A    queryKeys.forEach(function(key) %7B%0A        if (itm.hasOwnProperty(key)) %7B%0A            query%5Bkey%5D = itm%5Bkey%5D;%0A        %7D%0A    %7D);%0A
     itm.
@@ -905,19 +905,21 @@
 ringify(
-itm
+query
 );%0A%7D%0Amod

Whitelist keys to include in ss_data query strings