Const
获取 csv 文件的列数据。
import http from 'pts/http';
import dataset from 'pts/dataset';
export default function () {
const value = dataset.get('key1');
console.log('key1 => '+value)
const postResponse = http.post('http://mockhttpbin.pts.svc.cluster.local/post', JSON.stringify({data:value}));
};
列名
数据
随机获取参数文件一行。
import dataset from 'pts/dataset';
export default function () {
const record = dataset.random('test.csv');
console.log(JSON.stringify(record)); // {"key1":"1","key2":"2","key3":"3","key4":"4"}
console.log(record.key1); // 1
};
文件名。
一行数据。
增加一行参数文件。