mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-01-31 11:51:41 +03:00
Run tests in packages
This commit is contained in:
parent
e4ce71385f
commit
dabc7d9b8e
|
@ -4,6 +4,8 @@
|
|||
"lerna": "3.4.2"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "node ./scripts/run-in-packages npm run lint",
|
||||
"test": "node ./scripts/run-in-packages npm run test"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
|
|
21
scripts/run-in-packages.js
Normal file
21
scripts/run-in-packages.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
const path = require("path");
|
||||
const { readdirSync, statSync } = require('fs');
|
||||
const { execSync } = require("child_process");
|
||||
|
||||
const execArgs = { stdio: "inherit", env: process.env };
|
||||
const command = process.argv.slice(2).join(' ');
|
||||
|
||||
const getDirectories = srcPath => readdirSync(srcPath)
|
||||
.filter(file => statSync(path.join(srcPath, file)).isDirectory());
|
||||
|
||||
if (!command) {
|
||||
console.error('No command specified.')
|
||||
} else {
|
||||
const cwd = process.cwd();
|
||||
getDirectories('packages').forEach(packageName => {
|
||||
console.log(packageName, path.resolve(__dirname, "../packages/" + packageName));
|
||||
process.chdir(path.resolve(__dirname, "../packages/" + packageName));
|
||||
execSync(command, execArgs);
|
||||
});
|
||||
process.chdir(cwd);
|
||||
}
|
Loading…
Reference in New Issue
Block a user