send/test/frontend/index.js

19 lines
403 B
JavaScript
Raw Normal View History

2018-02-21 04:31:27 +00:00
const fs = require('fs');
const path = require('path');
function kv(f) {
return `require('./tests/${f}')`;
}
module.exports = function() {
const files = fs
.readdirSync(path.join(__dirname, 'tests'))
.filter(p => /\.js$/.test(p));
2022-08-09 15:37:16 +00:00
const code = files.map(kv).join(';\n');
2018-02-21 04:31:27 +00:00
return {
code,
dependencies: files.map(f => require.resolve('./tests/' + f)),
2018-03-02 21:58:05 +00:00
cacheable: true
2018-02-21 04:31:27 +00:00
};
};