mirror of
https://github.com/Tonejs/Tone.js
synced 2025-01-25 01:55:00 +00:00
ed71d8141b
no longer using AMD (require.js) style imports, and beginning to move to es6 "import/export" statements everywhere.
24 lines
645 B
JavaScript
24 lines
645 B
JavaScript
const glob = require("glob");
|
|
const fs = require("fs");
|
|
const { resolve } = require("path");
|
|
const argv = require("yargs")
|
|
.alias("i", "file")
|
|
.alias("d", "dir")
|
|
.argv;
|
|
|
|
/**
|
|
* COLLECT TESTS
|
|
*/
|
|
function collectTests(){
|
|
var tests = "../test/!(helper|deps|examples|html)/*.js";
|
|
if (typeof argv.file === "string"){
|
|
tests = `../test/*/${argv.file}.js`;
|
|
} else if (typeof argv.dir === "string"){
|
|
tests = `../test/${argv.dir}/*.js`;
|
|
}
|
|
const files = glob.sync(resolve(__dirname, tests));
|
|
var reqString = files.map(r => `import "${r}";`).join("\n");
|
|
fs.writeFileSync(resolve(__dirname, "../test/test.js"), reqString);
|
|
}
|
|
|
|
collectTests();
|