2018-02-21 05:31:27 +01:00
|
|
|
const fs = require('fs');
|
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
function kv(f) {
|
|
|
|
return `require('./tests/${f}')`;
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = function() {
|
2018-05-29 23:39:54 +02:00
|
|
|
const files = fs
|
|
|
|
.readdirSync(path.join(__dirname, 'tests'))
|
|
|
|
.filter(p => /\.js$/.test(p));
|
2018-03-01 04:24:41 +01:00
|
|
|
const code = "require('fast-text-encoding');\n" + files.map(kv).join(';\n');
|
2018-02-21 05:31:27 +01:00
|
|
|
return {
|
|
|
|
code,
|
|
|
|
dependencies: files.map(f => require.resolve('./tests/' + f)),
|
2018-03-02 22:58:05 +01:00
|
|
|
cacheable: true
|
2018-02-21 05:31:27 +01:00
|
|
|
};
|
|
|
|
};
|