You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
soapbox/jest/assetTransformer.js

13 lines
362 B

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) {
return {
code: `module.exports = "https://soapbox.test/assets/${path.basename(filename)}";`,
};
},
};