-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
deprecation.js
26 lines (22 loc) · 915 Bytes
/
deprecation.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const chalk = require('chalk');
const log = require('../../src/utils/logger').child({ __filename });
const migrationGuideUrl = 'https://wix.to/I0DOAK0';
function coerceDeprecation(option) {
return function coerceDeprecationFn(value) {
log.warn(`Beware: ${option} will be removed in the next version of Detox.`);
log.warn(`See the migration guide: ${migrationGuideUrl}`);
return value;
};
}
function printFileDeprecationWarning(file) {
log.warn('Deprecated: "file" option in "detox" section of package.json won\'t be supported in the next Detox version.\n');
console.log(` "detox": {`);
console.log(chalk.red(`- "file": ${JSON.stringify(file)},`));
console.log(chalk.green(`+ "specs": ${JSON.stringify(file)},\n`));
log.warn(`Please rename it to "specs", as demonstrated above.`);
}
module.exports = {
coerceDeprecation,
migrationGuideUrl,
printFileDeprecationWarning,
};