mirror of
https://github.com/curlconverter/curlconverter.git
synced 2022-05-22 02:35:29 +03:00
update grunt config to run tape tests
This commit is contained in:
@@ -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();
|
||||
});
|
||||
Reference in New Issue
Block a user