hi
how to import function set in app.js called fetchUrlData()
i make an export,
module.exports = {
app,
getCurrentDateFormat
};
but on test.js file,
TypeError: getCurrentDateFormat is not a function
hi
how to import function set in app.js called fetchUrlData()
i make an export,
module.exports = {
app,
getCurrentDateFormat
};
but on test.js file,
TypeError: getCurrentDateFormat is not a function
the the steps I do for unit test
in app.js export function need tested
module.exports = {
app,
getCurrentDateFormat,
fetchUrlData
};
in test/mytest.test.js , we need import
const {
getCurrentDateFormat,
fetchUrlData
} = require('../src/app');
so, launch jest
and we have message display
config.js missing in root dir
so i add empty config.js