diff --git a/test/_fixtures/config/file-with-repo-presets.js b/test/_fixtures/config/file-with-repo-presets.js index 77100dd6fb4d93ed3f5e45a8fa153d283d153b24..d295536f8207cc8bbf717f7f1504ca43be9fa94b 100644 --- a/test/_fixtures/config/file-with-repo-presets.js +++ b/test/_fixtures/config/file-with-repo-presets.js @@ -15,7 +15,7 @@ module.exports = { }, { repository: 'rennovateapp/github-app-cli', - extends: [':base', ':prHourlyLimit2'] + extends: [':prHourlyLimit2'] } ], }; diff --git a/test/config/__snapshots__/index.spec.js.snap b/test/config/__snapshots__/index.spec.js.snap index 39b88ea51c0ff4f0e8905daedc9f368b5d38fafc..7f9a85412531300db54f8279caf7c98b7c43cfe1 100644 --- a/test/config/__snapshots__/index.spec.js.snap +++ b/test/config/__snapshots__/index.spec.js.snap @@ -903,699 +903,11 @@ Object { exports[`config/index .parseConfigs(env, defaultArgv) resolves all presets: rennovateapp/github-app-cli 1`] = ` Object { - "automerge": false, - "branchPrefix": "renovate/", - "dependencies": Object { - "description": Array [ - "Use <code>fix</code> as semantic commit type for commit messages and PR titles", - ], - "semanticCommitType": "fix", - }, "description": Array [ - "Separate major versions of dependencies into individual branches/PRs", - "Combine any patch and minor upgrades together into same branch/PR", - "Upgrade to unstable versions only if the existing version is unstable", - "Raise PRs immediately (after branch is created)", - "Use <code>renovate/</code> as prefix for all branch names", - "If semantic commits detected, use semantic commit type <code>fix</code> for dependencies and <code>chore</code> for all others", - "Keep existing branches updated even when not scheduled", - "Disable automerging feature - wait for humans to merge all PRs", - "Ignore \`node_modules\`, \`bower_components\`, and various test/tests directories", - "Update existing lock files only when <code>package.json</code> is modified", - "Autodetect whether to pin dependencies or maintain ranges", "Rate limit PR creation to a maximum of two per hour", - "Limit to maximum 20 concurrent Renovate PRs at any time", - "Preconfigure dependencies where an odd major version indicates unstable (Docker-only)", - "Rate limit PR creation to a maximum of two per hour", - ], - "devDependencies": Object { - "description": Array [ - "Use <code>chore</code> as semantic commit type for commit messages and PR titles", - ], - "semanticCommitType": "chore", - }, - "ignorePaths": Array [ - "**/node_modules/**", - "**/bower_components/**", - "**/examples/**", - "**/__tests__/**", - "**/test/**", - "**/tests/**", - ], - "ignoreUnstable": true, - "lockFileMaintenance": Object { - "enabled": false, - }, - "optionalDependencies": Object { - "description": Array [ - "Use <code>chore</code> as semantic commit type for commit messages and PR titles", - ], - "semanticCommitType": "chore", - }, - "packageNames": Array [ - "mhart/alpine-node", - "node", - "ubuntu", - ], - "packageRules": Array [ - Object { - "description": Array [ - "Group packages from accounts monorepo together", - ], - "groupName": "accounts monorepo", - "packageNames": Array [ - "@accounts/client", - "@accounts/common", - "@accounts/mongo", - "@accounts/error", - "@accounts/oauth-instagram", - "@accounts/oauth-twitter", - "@accounts/oauth", - "@accounts/password", - "@accounts/rest-client", - "@accounts/rest-express", - "@accounts/server", - "@accounts/two-factor", - "@accounts/types", - ], - }, - Object { - "description": Array [ - "Group packages from angular monorepo together", - ], - "groupName": "angular monorepo", - "packageNames": Array [ - "@angular/animations", - "@angular/bazel", - "@angular/benchpress", - "@angular/common", - "@angular/compiler-cli", - "@angular/compiler", - "@angular/core", - "@angular/elements", - "@angular/forms", - "@angular/http", - "@angular/language-service", - "@angular/platform-browser-dynamic", - "@angular/platform-browser", - "@angular/platform-server", - "@angular/platform-webworker-dynamic", - "@angular/platform-webworker", - "@angular/router", - "@angular/service-worker", - "@angular/upgrade", - ], - }, - Object { - "description": Array [ - "Group packages from angular1 monorepo together", - ], - "groupName": "angular1 monorepo", - "packageNames": Array [ - "angular", - "angular-animate", - "angular-aria", - "angular-cookies", - "angular-loader", - "angular-message-format", - "angular-messages", - "angular-mocks", - "angular-parse-ext", - "angular-resource", - "angular-route", - "angular-sanitize", - "angular-scenario", - "angular-touch", - ], - }, - Object { - "description": Array [ - "Group packages from babel monorepo together", - ], - "groupName": "babel monorepo", - "packageNames": Array [ - "@babel/cli", - "@babel/code-frame", - "@babel/core", - "@babel/generator", - "@babel/helper-annotate-as-pure", - "@babel/helper-bindify-decorators", - "@babel/helper-builder-binary-assignment-operator-visitor", - "@babel/helper-builder-react-jsx", - "@babel/helper-call-delegate", - "@babel/helper-define-map", - "@babel/helper-explode-assignable-expression", - "@babel/helper-explode-class", - "@babel/helper-fixtures", - "@babel/helper-function-name", - "@babel/helper-get-function-arity", - "@babel/helper-hoist-variables", - "@babel/helper-module-imports", - "@babel/helper-module-transforms", - "@babel/helper-optimise-call-expression", - "@babel/helper-plugin-test-runner", - "@babel/helper-plugin-utils", - "@babel/helper-regex", - "@babel/helper-remap-async-to-generator", - "@babel/helper-replace-supers", - "@babel/helper-simple-access", - "@babel/helper-split-export-declaration", - "@babel/helper-transform-fixture-test-runner", - "@babel/helper-wrap-function", - "@babel/helpers", - "@babel/highlight", - "@babel/node", - "@babel/plugin-external-helpers", - "@babel/plugin-proposal-async-generator-functions", - "@babel/plugin-proposal-class-properties", - "@babel/plugin-proposal-decorators", - "@babel/plugin-proposal-do-expressions", - "@babel/plugin-proposal-export-default-from", - "@babel/plugin-proposal-export-namespace-from", - "@babel/plugin-proposal-function-bind", - "@babel/plugin-proposal-function-sent", - "@babel/plugin-proposal-logical-assignment-operators", - "@babel/plugin-proposal-nullish-coalescing-operator", - "@babel/plugin-proposal-numeric-separator", - "@babel/plugin-proposal-object-rest-spread", - "@babel/plugin-proposal-optional-catch-binding", - "@babel/plugin-proposal-optional-chaining", - "@babel/plugin-proposal-pipeline-operator", - "@babel/plugin-proposal-throw-expressions", - "@babel/plugin-proposal-unicode-property-regex", - "@babel/plugin-syntax-async-generators", - "@babel/plugin-syntax-class-properties", - "@babel/plugin-syntax-decorators", - "@babel/plugin-syntax-do-expressions", - "@babel/plugin-syntax-dynamic-import", - "@babel/plugin-syntax-export-default-from", - "@babel/plugin-syntax-export-namespace-from", - "@babel/plugin-syntax-flow", - "@babel/plugin-syntax-function-bind", - "@babel/plugin-syntax-function-sent", - "@babel/plugin-syntax-import-meta", - "@babel/plugin-syntax-jsx", - "@babel/plugin-syntax-logical-assignment-operators", - "@babel/plugin-syntax-nullish-coalescing-operator", - "@babel/plugin-syntax-numeric-separator", - "@babel/plugin-syntax-object-rest-spread", - "@babel/plugin-syntax-optional-catch-binding", - "@babel/plugin-syntax-optional-chaining", - "@babel/plugin-syntax-pipeline-operator", - "@babel/plugin-syntax-throw-expressions", - "@babel/plugin-syntax-typescript", - "@babel/plugin-transform-arrow-functions", - "@babel/plugin-transform-async-to-generator", - "@babel/plugin-transform-block-scoped-functions", - "@babel/plugin-transform-block-scoping", - "@babel/plugin-transform-classes", - "@babel/plugin-transform-computed-properties", - "@babel/plugin-transform-destructuring", - "@babel/plugin-transform-dotall-regex", - "@babel/plugin-transform-duplicate-keys", - "@babel/plugin-transform-exponentiation-operator", - "@babel/plugin-transform-flow-comments", - "@babel/plugin-transform-flow-strip-types", - "@babel/plugin-transform-for-of", - "@babel/plugin-transform-function-name", - "@babel/plugin-transform-instanceof", - "@babel/plugin-transform-jscript", - "@babel/plugin-transform-literals", - "@babel/plugin-transform-member-expression-literals", - "@babel/plugin-transform-modules-amd", - "@babel/plugin-transform-modules-commonjs", - "@babel/plugin-transform-modules-systemjs", - "@babel/plugin-transform-modules-umd", - "@babel/plugin-transform-new-target", - "@babel/plugin-transform-object-assign", - "@babel/plugin-transform-object-set-prototype-of-to-assign", - "@babel/plugin-transform-object-super", - "@babel/plugin-transform-parameters", - "@babel/plugin-transform-property-literals", - "@babel/plugin-transform-property-mutators", - "@babel/plugin-transform-proto-to-assign", - "@babel/plugin-transform-react-constant-elements", - "@babel/plugin-transform-react-display-name", - "@babel/plugin-transform-react-inline-elements", - "@babel/plugin-transform-react-jsx-compat", - "@babel/plugin-transform-react-jsx-self", - "@babel/plugin-transform-react-jsx-source", - "@babel/plugin-transform-react-jsx", - "@babel/plugin-transform-regenerator", - "@babel/plugin-transform-reserved-words", - "@babel/plugin-transform-runtime", - "@babel/plugin-transform-shorthand-properties", - "@babel/plugin-transform-spread", - "@babel/plugin-transform-sticky-regex", - "@babel/plugin-transform-strict-mode", - "@babel/plugin-transform-template-literals", - "@babel/plugin-transform-typeof-symbol", - "@babel/plugin-transform-typescript", - "@babel/plugin-transform-unicode-regex", - "@babel/polyfill", - "@babel/preset-env-standalone", - "@babel/preset-env", - "@babel/preset-es2015", - "@babel/preset-es2016", - "@babel/preset-es2017", - "@babel/preset-flow", - "@babel/preset-react", - "@babel/preset-stage-0", - "@babel/preset-stage-1", - "@babel/preset-stage-2", - "@babel/preset-stage-3", - "@babel/preset-typescript", - "@babel/register", - "@babel/runtime", - "@babel/standalone", - "@babel/template", - "@babel/traverse", - "@babel/types", - "babylon", - ], - }, - Object { - "description": Array [ - "Group packages from babel6 monorepo together", - ], - "groupName": "babel6 monorepo", - "packageNames": Array [ - "babel-cli", - "babel-code-frame", - "babel-core", - "babel-generator", - "babel-helper-bindify-decorators", - "babel-helper-builder-binary-assignment-operator-visitor", - "babel-helper-builder-react-jsx", - "babel-helper-call-delegate", - "babel-helper-define-map", - "babel-helper-explode-assignable-expression", - "babel-helper-explode-class", - "babel-helper-fixtures", - "babel-helper-function-name", - "babel-helper-get-function-arity", - "babel-helper-hoist-variables", - "babel-helper-optimise-call-expression", - "babel-helper-plugin-test-runner", - "babel-helper-regex", - "babel-helper-remap-async-to-generator", - "babel-helper-replace-supers", - "babel-helper-transform-fixture-test-runner", - "babel-helpers", - "babel-plugin-external-helpers", - "babel-plugin-syntax-async-generators", - "babel-plugin-syntax-class-properties", - "babel-plugin-syntax-decorators", - "babel-plugin-syntax-do-expressions", - "babel-plugin-syntax-dynamic-import", - "babel-plugin-syntax-flow", - "babel-plugin-syntax-function-bind", - "babel-plugin-syntax-function-sent", - "babel-plugin-syntax-jsx", - "babel-plugin-syntax-object-rest-spread", - "babel-plugin-transform-async-to-generator", - "babel-plugin-transform-exponentiation-operator", - "babel-plugin-transform-flow-comments", - "babel-plugin-transform-flow-strip-types", - "babel-plugin-transform-jscript", - "babel-plugin-transform-object-assign", - "babel-plugin-transform-object-set-prototype-of-to-assign", - "babel-plugin-transform-proto-to-assign", - "babel-plugin-transform-react-constant-elements", - "babel-plugin-transform-react-display-name", - "babel-plugin-transform-react-inline-elements", - "babel-plugin-transform-react-jsx-compat", - "babel-plugin-transform-react-jsx-self", - "babel-plugin-transform-react-jsx-source", - "babel-plugin-transform-react-jsx", - "babel-plugin-transform-regenerator", - "babel-plugin-transform-runtime", - "babel-plugin-transform-strict-mode", - "babel-polyfill", - "babel-preset-es2015", - "babel-preset-es2016", - "babel-preset-es2017", - "babel-preset-flow", - "babel-preset-react", - "babel-preset-stage-0", - "babel-preset-stage-1", - "babel-preset-stage-2", - "babel-preset-stage-3", - "babel-register", - "babel-runtime", - "babel-template", - "babel-traverse", - "babel-types", - ], - }, - Object { - "description": Array [ - "Group packages from commitlint monorepo together", - ], - "groupName": "commitlint monorepo", - "packageNames": Array [ - "commitlint", - ], - "packagePatterns": Array [ - "^@commitlint/", - ], - }, - Object { - "description": Array [ - "Group packages from fimbullinter monorepo together", - ], - "groupName": "fimbullinter monorepo", - "packagePatterns": Array [ - "^@fimbul/", - ], - }, - Object { - "description": Array [ - "Group packages from gatsby monorepo together", - ], - "groupName": "gatsby monorepo", - "packageNames": Array [ - "gatsby-1-config-css-modules", - "gatsby-1-config-extract-plugin", - "gatsby-cli", - "gatsby-dev-cli", - "gatsby-image", - "gatsby-link", - "gatsby-module-loader", - "gatsby-plugin-aphrodite", - "gatsby-plugin-canonical-urls", - "gatsby-plugin-catch-links", - "gatsby-plugin-coffeescript", - "gatsby-plugin-create-client-paths", - "gatsby-plugin-cxs", - "gatsby-plugin-emotion", - "gatsby-plugin-facebook-analytics", - "gatsby-plugin-feed", - "gatsby-plugin-fullstory", - "gatsby-plugin-glamor", - "gatsby-plugin-glamorous", - "gatsby-plugin-google-analytics", - "gatsby-plugin-google-tagmanager", - "gatsby-plugin-jss", - "gatsby-plugin-less", - "gatsby-plugin-lodash", - "gatsby-plugin-manifest", - "gatsby-plugin-netlify-cms", - "gatsby-plugin-netlify", - "gatsby-plugin-no-sourcemaps", - "gatsby-plugin-nprogress", - "gatsby-plugin-offline", - "gatsby-plugin-postcss-sass", - "gatsby-plugin-preact", - "gatsby-plugin-react-css-modules", - "gatsby-plugin-react-helmet", - "gatsby-plugin-react-next", - "gatsby-plugin-remove-trailing-slashes", - "gatsby-plugin-sass", - "gatsby-plugin-sharp", - "gatsby-plugin-sitemap", - "gatsby-plugin-styled-components", - "gatsby-plugin-styled-jsx", - "gatsby-plugin-styletron", - "gatsby-plugin-stylus", - "gatsby-plugin-twitter", - "gatsby-plugin-typescript", - "gatsby-plugin-typography", - "gatsby-react-router-scroll", - "gatsby-remark-autolink-headers", - "gatsby-remark-code-repls", - "gatsby-remark-copy-linked-files", - "gatsby-remark-custom-blocks", - "gatsby-remark-embed-snippet", - "gatsby-remark-images", - "gatsby-remark-katex", - "gatsby-remark-prismjs", - "gatsby-remark-responsive-iframe", - "gatsby-remark-smartypants", - "gatsby-source-contentful", - "gatsby-source-drupal", - "gatsby-source-faker", - "gatsby-source-filesystem", - "gatsby-source-hacker-news", - "gatsby-source-lever", - "gatsby-source-medium", - "gatsby-source-mongodb", - "gatsby-source-wordpress-com", - "gatsby-source-wordpress", - "gatsby-transformer-csv", - "gatsby-transformer-documentationjs", - "gatsby-transformer-docx", - "gatsby-transformer-excel", - "gatsby-transformer-hjson", - "gatsby-transformer-javascript-frontmatter", - "gatsby-transformer-javascript-static-exports", - "gatsby-transformer-json", - "gatsby-transformer-pdf", - "gatsby-transformer-pdfimages", - "gatsby-transformer-react-docgen", - "gatsby-transformer-remark", - "gatsby-transformer-screenshot", - "gatsby-transformer-sharp", - "gatsby-transformer-toml", - "gatsby-transformer-xml", - "gatsby-transformer-yaml", - "gatsby", - "graphql-skip-limit", - ], - }, - Object { - "description": Array [ - "Group packages from jest monorepo together", - ], - "groupName": "jest monorepo", - "packageNames": Array [ - "babel-jest", - "babel-plugin-jest-hoist", - "babel-preset-jest", - "diff-sequences", - "eslint-config-fb-strict", - "expect", - "jest-changed-files", - "jest-circus", - "jest-cli", - "jest-config", - "jest-diff", - "jest-docblock", - "jest-editor-support", - "jest-environment-jsdom", - "jest-environment-node", - "jest-get-type", - "jest-haste-map", - "jest-jasmine2", - "jest-leak-detector", - "jest-matcher-utils", - "jest-message-util", - "jest-mock", - "jest-phabricator", - "jest-regex-util", - "jest-repl", - "jest-resolve-dependencies", - "jest-resolve", - "jest-runner", - "jest-runtime", - "jest-serializer", - "jest-snapshot", - "jest-test-typescript-parser", - "jest-util", - "jest-validate", - "jest-worker", - "jest", - "pretty-format", - ], - }, - Object { - "description": Array [ - "Group packages from lodash monorepo together", - ], - "groupName": "lodash monorepo", - "packageNames": Array [ - "babel-plugin-lodash", - "lodash-webpack-plugin", - "lodash-es", - ], - "packagePatterns": Array [ - "^lodash", - ], - }, - Object { - "description": Array [ - "Group packages from material monorepo together", - ], - "groupName": "material monorepo", - "packageNames": Array [ - "material-components-web", - "@material/animation", - "@material/auto-init", - "@material/base", - "@material/button", - "@material/card", - "@material/checkbox", - "@material/chips", - "@material/dialog", - "@material/drawer", - "@material/elevation", - "@material/fab", - "@material/floating-label", - "@material/form-field", - "@material/grid-list", - "@material/icon-toggle", - "@material/image-list", - "@material/layout-grid", - "@material/line-ripple", - "@material/linear-progress", - "@material/list", - "@material/menu", - "@material/notched-outline", - "@material/radio", - "@material/ripple", - "@material/rtl", - "@material/select", - "@material/selection-control", - "@material/slider", - "@material/snackbar", - "@material/switch", - "@material/tabs", - "@material/textfield", - "@material/theme", - "@material/toolbar", - "@material/top-app-bar", - "@material/typography", - ], - }, - Object { - "description": Array [ - "Group packages from neutrino monorepo together", - ], - "groupName": "neutrino monorepo", - "packageNames": Array [ - "neutrino", - ], - "packagePatterns": Array [ - "^@neutrinojs/", - ], - }, - Object { - "description": Array [ - "Group packages from ngrx monorepo together", - ], - "groupName": "ngrx monorepo", - "packageNames": Array [ - "ngrx", - ], - "packagePatterns": Array [ - "^@ngrx/", - ], - }, - Object { - "description": Array [ - "Group packages from nrwl monorepo together", - ], - "groupName": "nrwl monorepo", - "packageNames": Array [ - "nrwl", - ], - "packagePatterns": Array [ - "^@nrwl/", - ], - }, - Object { - "description": Array [ - "Group packages from pouchdb monorepo together", - ], - "groupName": "pouchdb monorepo", - "packageNames": Array [ - "pouchdb-abstract-mapreduce", - "pouchdb-adapter-fruitdown", - "pouchdb-adapter-http", - "pouchdb-adapter-idb", - "pouchdb-adapter-leveldb-core", - "pouchdb-adapter-leveldb", - "pouchdb-adapter-localstorage", - "pouchdb-adapter-memory", - "pouchdb-adapter-node-websql", - "pouchdb-adapter-utils", - "pouchdb-adapter-websql-core", - "pouchdb-adapter-websql", - "pouchdb-binary-utils", - "pouchdb-browser", - "pouchdb-changes-filter", - "pouchdb-checkpointer", - "pouchdb-collate", - "pouchdb-collections", - "pouchdb-core", - "pouchdb-debug", - "pouchdb-errors", - "pouchdb-fetch", - "pouchdb-find", - "pouchdb-generate-replication-id", - "pouchdb-json", - "pouchdb-mapreduce-utils", - "pouchdb-mapreduce", - "pouchdb-md5", - "pouchdb-merge", - "pouchdb-node", - "pouchdb-replication", - "pouchdb-selector-core", - "pouchdb-utils", - "pouchdb", - "sublevel-pouchdb", - ], - }, - Object { - "description": Array [ - "Group packages from react monorepo together", - ], - "groupName": "react monorepo", - "packageNames": Array [ - "create-subscription", - "react-art", - "react-call-return", - "react-dom", - "react-is", - "react-reconciler", - "react-test-renderer", - "react", - "simple-cache-provider", - ], - }, - Object { - "description": Array [ - "Group packages from storybook monorepo together", - ], - "groupName": "storybook monorepo", - "packagePatterns": Array [ - "^@storybook/", - ], - }, - Object { - "major": Object { - "enabled": false, - }, - "packageNames": Array [ - "@types/node", - ], - }, ], - "peerDependencies": Object { - "description": Array [ - "Use <code>chore</code> as semantic commit type for commit messages and PR titles", - ], - "semanticCommitType": "chore", - }, - "pinVersions": null, - "prConcurrentLimit": 20, - "prCreation": "immediate", "prHourlyLimit": 2, "repository": "rennovateapp/github-app-cli", - "separateMajorReleases": true, - "separatePatchReleases": false, - "unstablePattern": "^\\\\d*[13579]($|.)", - "updateNotScheduled": true, } `; diff --git a/test/config/index.spec.js b/test/config/index.spec.js index 9aebc83ec56a837483431c454c0b23b18aa182bf..ffd53cae28554a3f8b1ec11a0883e4dbacaea80e 100644 --- a/test/config/index.spec.js +++ b/test/config/index.spec.js @@ -1,5 +1,14 @@ const argv = require('../_fixtures/config/argv'); const defaultConfig = require('../../lib/config/defaults').getConfig(); +const npm = require('../../lib/datasource/npm'); +const presetDefaults = require('../_fixtures/npm/renovate-config-default'); + +npm.getDependency = jest.fn(() => ({ + 'renovate-config': + presetDefaults.versions[presetDefaults['dist-tags'].latest][ + 'renovate-config' + ], +})); describe('config/index', () => { describe('.parseConfigs(env, defaultArgv)', () => {