2022-04-05 12:21:01 -07:00
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
// Custom Jest asset transformer
|
|
|
|
// https://jestjs.io/docs/code-transformation#writing-custom-transformers
|
|
|
|
// Tries to do basically what Webpack does
|
|
|
|
module.exports = {
|
|
|
|
process(src, filename, config, options) {
|
2022-07-05 09:30:08 -07:00
|
|
|
return {
|
|
|
|
code: `module.exports = "https://soapbox.test/assets/${path.basename(filename)}";`,
|
|
|
|
};
|
2022-04-05 12:21:01 -07:00
|
|
|
},
|
|
|
|
};
|