Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate old test script commands #19893

Merged
merged 7 commits into from
Oct 14, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
2. Run `yarn` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development.
5. Run `yarn test-prod` to test in the production environment. It supports the same options as `yarn test`.
5. Run `yarn test --prod` to test in the production environment. It supports the same options as `yarn test`.
6. If you need a debugger, run `yarn debug-test --watch TestName`, open `chrome://inspect`, and press "Inspect".
7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files.
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,21 @@
"lint-build": "node ./scripts/rollup/validate/index.js",
"extract-errors": "yarn build --type=dev --extract-errors",
"postinstall": "node node_modules/fbjs-scripts/node/check-dev-engines.js package.json && node ./scripts/flow/createFlowConfigs.js && node ./scripts/yarn/downloadReactIsForPrettyFormat.js",
"debug-test": "yarn test --debug",
"debug-test": "yarn test --deprecated 'yarn test --debug'",
"test": "node ./scripts/jest/jest-cli.js",
"test-www": "yarn test --release-channel=www-modern",
"test-www-variant": "yarn test --release-channel=www-modern --variant",
"test-prod-www": "yarn test --prod --release-channel=www-modern",
"test-prod-www-variant": "yarn test --prod --release-channel=www-modern --variant",
"test-persistent": "yarn test --persistent",
"debug-test-persistent": "yarn test --debug --persistent",
"test-prod": "yarn test --prod",
"debug-test-prod": "yarn test --debug --prod",
"test-prod-build": "yarn test --prod --build",
"test-build": "yarn test --build",
"test-build-prod": "yarn test --build --prod",
"test-www-variant": "yarn test --deprecated 'yarn test-www --variant'",
"test-prod-www": "yarn test --deprecated 'yarn test-www --prod'",
"test-prod-www-variant": "yarn test --deprecated 'yarn test-www --prod --variant'",
"test-persistent": "yarn test --deprecated 'yarn test --persistent'",
"debug-test-persistent": "yarn test --deprecated 'yarn test --debug --persistent'",
"test-prod": "yarn test --deprecated 'yarn test --prod'",
"debug-test-prod": "yarn test --deprecated 'yarn test --debug --prod'",
"test-prod-build": "yarn test --deprecated 'yarn test --prod --build'",
"test-build": "yarn test --deprecated 'yarn test --build'",
"test-build-prod": "yarn test --deprecated 'yarn test --build --prod'",
"test-build-devtools": "yarn test --build --project devtools",
"debug-test-build-devtools": "yarn test --debug --build --project devtools",
"debug-test-build-devtools": "yarn test --deprecated 'yarn test-build-devtools --debug'",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the end we'll have three base test commands:

  • test
  • test-www
  • test-build-devtools

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we already only have three commands since the aliases proxy to them.

"test-dom-fixture": "cd fixtures/dom && yarn && yarn prestart && yarn test",
"flow": "node ./scripts/tasks/flow.js",
"flow-ci": "node ./scripts/tasks/flow-ci.js",
Expand Down
9 changes: 9 additions & 0 deletions scripts/jest/jest-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ const argv = yargs
type: 'boolean',
default: false,
},
deprecated: {
describe: 'Print deprecation message for command.',
requiresArg: true,
type: 'string',
},
}).argv;

function logError(message) {
Expand Down Expand Up @@ -287,6 +292,10 @@ function getEnvars() {
}

function main() {
if (argv.deprecated) {
console.log(chalk.red(`\nPlease run: \`${argv.deprecated}\` instead.\n`));
return;
}
validateOptions();
const args = getCommandArgs();
const envars = getEnvars();
Expand Down