mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-16 10:45:53 -07:00
Add chalk
This commit is contained in:
parent
1f9ad7c0ad
commit
1ea00f1616
2 changed files with 7 additions and 6 deletions
|
|
@ -22,7 +22,7 @@ const run = async (tests) => {
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log(err);
|
console.error(err);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
/* eslint no-console: 0 */ // --> OFF
|
/* eslint no-console: 0 */ // --> OFF
|
||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
const chalk = require('chalk');
|
||||||
const childProcess = require('child_process');
|
const childProcess = require('child_process');
|
||||||
|
|
||||||
const filenames = fs.readdirSync(`${process.cwd()}/Community`);
|
const filenames = fs.readdirSync(`${process.cwd()}/Community`);
|
||||||
|
|
@ -13,15 +14,15 @@ const run = async () => {
|
||||||
|
|
||||||
let shouldRunTest = true;
|
let shouldRunTest = true;
|
||||||
if (!text.includes('// tdarrSkipTest') && !fs.existsSync(pluginTestpath)) {
|
if (!text.includes('// tdarrSkipTest') && !fs.existsSync(pluginTestpath)) {
|
||||||
console.log(`${filenames[i]} does not have a test but should do.`);
|
console.log(chalk.red(`${filenames[i]} does not have a test but should do.`));
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
} else if (!text.includes('// tdarrSkipTest') && fs.existsSync(pluginTestpath)) {
|
} else if (!text.includes('// tdarrSkipTest') && fs.existsSync(pluginTestpath)) {
|
||||||
console.log(`${filenames[i]} running test`);
|
console.log(chalk.white(`${filenames[i]} running test`));
|
||||||
} else if (text.includes('// tdarrSkipTest') && fs.existsSync(pluginTestpath)) {
|
} else if (text.includes('// tdarrSkipTest') && fs.existsSync(pluginTestpath)) {
|
||||||
console.log(`${filenames[i]} should have // tdarrSkipTest removed`);
|
console.log(chalk.red(`${filenames[i]} should have // tdarrSkipTest removed`));
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
} else if (text.includes('// tdarrSkipTest') && !fs.existsSync(pluginTestpath)) {
|
} else if (text.includes('// tdarrSkipTest') && !fs.existsSync(pluginTestpath)) {
|
||||||
console.log(`${filenames[i]} skipping tests`);
|
console.log(chalk.yellow(`${filenames[i]} skipping tests`));
|
||||||
shouldRunTest = false;
|
shouldRunTest = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -33,7 +34,7 @@ const run = async () => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
console.log(stderr);
|
console.log(chalk.red(stderr));
|
||||||
}).on('exit', async (code) => {
|
}).on('exit', async (code) => {
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
await new Promise((resolve2) => setTimeout(resolve2, 1000));
|
await new Promise((resolve2) => setTimeout(resolve2, 1000));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue