update grunt config to run tape tests

This commit is contained in:
Nick Carneiro
2014-12-30 13:49:34 -06:00
parent 283f4021a4
commit 24ae9efe41
3 changed files with 22 additions and 20 deletions

View File

@@ -1,4 +1,3 @@
/*global describe, it */
'use strict';
var test = require('tape');
var fs = require('fs');
@@ -6,18 +5,18 @@ var fs = require('fs');
var curlconverter = require('../');
test('http get - python', function (t) {
var curlHttpGetCommand = fs.readFileSync('curl1.txt', 'utf-8');
var curlHttpGetCommand = fs.readFileSync(__dirname + '/curl1.txt', 'utf-8');
var pythonCode = curlconverter.toPython(curlHttpGetCommand);
var goodPythonCode = fs.readFileSync('python_output1.py', 'utf-8');
var goodPythonCode = fs.readFileSync(__dirname + '/python_output1.py', 'utf-8');
t.equal(goodPythonCode, pythonCode);
t.end();
});
test('http post - python', function (t) {
var curlHttpGetCommand = fs.readFileSync('curl2.txt', 'utf-8');
var curlHttpGetCommand = fs.readFileSync(__dirname + '/curl2.txt', 'utf-8');
var pythonCode = curlconverter.toPython(curlHttpGetCommand);
var goodPythonCode = fs.readFileSync('python_output2.py', 'utf-8');
var goodPythonCode = fs.readFileSync(__dirname + '/python_output2.py', 'utf-8');
t.equal(goodPythonCode, pythonCode);
t.end();
});