def verify_js(output, template, data): if json is None: warnings.warn('json module missing, skipping this js test') return script = render_js(template) print("%s with %s" % (template, data)) result = subprocess.check_output(["node", "-e", "console.log({0}({1}))".format(script, json.dumps(data))]).strip() print("Result: %s\n" % result) assert output.lower() == result
def bare_js(output, template, data): script = render_js(template)