我在使用Jest的单元测试用例中需要文件时遇到问题。以下是我想在测试用例中测试已经导出的方法的文件
use strict ';
const constantObj = require('../constants');
const request = require('request');
const restClientObj = require('../middleware/restClient');
const taxonomiesDTOObj = require('../dto/taxonomyDTO');
const utilDTOObj = require('../dto/utilDTO');
const serverBaseUrl = require('../config/config');
const async = require('async');
let processData = (options, callback) => {
});
};
module.exports = {
processData
}
下面是需要上述文件的测试文件
const taxonomiesObj = require('../../services/taxonomies');
const utilDTOObj = require('../../dto/utilDTO');
const constantObj = require('../../constants');
describe('Testing data', function () {
it('It should process the payload and return the appropriate payload',
(done) => {
const callback = jest.fn(function (err, result) {
expect(err).toBe(null);
expect(result.status).toBe(200);
done();
});
taxonomiesObj.processData(options , callback);
});
})
我遇到以下错误