Skip to content

Commit

Permalink
chore: test fixes for breaking changes in workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar authored and lukekarrys committed Jul 26, 2023
1 parent db91a77 commit d2c3712
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 52 deletions.
8 changes: 1 addition & 7 deletions tap-snapshots/test/lib/commands/config.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ exports[`test/lib/commands/config.js TAP config list --json > output matches sna
"cafile": null,
"call": "",
"cert": null,
"ci-name": null,
"cidr": null,
"color": true,
"commit-hooks": true,
Expand Down Expand Up @@ -147,7 +146,6 @@ exports[`test/lib/commands/config.js TAP config list --json > output matches sna
"tag": "latest",
"tag-version-prefix": "v",
"timing": false,
"tmp": "{TMP}",
"umask": 0,
"unicode": false,
"update-notifier": true,
Expand All @@ -161,8 +159,7 @@ exports[`test/lib/commands/config.js TAP config list --json > output matches sna
"workspaces": null,
"workspaces-update": true,
"yes": null,
"npm-version": "{NPM-VERSION}",
"metrics-registry": "https://registry.npmjs.org/"
"npm-version": "{NPM-VERSION}"
}
`

Expand All @@ -187,7 +184,6 @@ cache-min = 0
cafile = null
call = ""
cert = null
ci-name = null
cidr = null
color = true
commit-hooks = true
Expand Down Expand Up @@ -254,7 +250,6 @@ logs-max = 10
; long = false ; overridden by cli
maxsockets = 15
message = "%s"
metrics-registry = "https://registry.npmjs.org/"
node-options = null
noproxy = [""]
npm-version = "{NPM-VERSION}"
Expand Down Expand Up @@ -306,7 +301,6 @@ strict-ssl = true
tag = "latest"
tag-version-prefix = "v"
timing = false
tmp = "{TMP}"
umask = 0
unicode = false
update-notifier = true
Expand Down
34 changes: 0 additions & 34 deletions tap-snapshots/test/lib/docs.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1822,20 +1822,6 @@ registry-scoped "certfile" path like
#### \`ci-name\`
* Default: The name of the current CI system, or \`null\` when not on a known CI
platform.
* Type: null or String
* DEPRECATED: This config is deprecated and will not be changeable in future
version of npm.
The name of a continuous integration system. If not set explicitly, npm will
detect the current CI environment using the
[\`ci-info\`](http://npm.im/ci-info) module.
#### \`dev\`
* Default: false
Expand Down Expand Up @@ -1995,20 +1981,6 @@ Alias for \`--omit=dev\`
Alias for --package-lock
#### \`tmp\`
* Default: The value returned by the Node.js \`os.tmpdir()\` method
<https://nodejs.org/api/os.html#os_os_tmpdir>
* Type: Path
* DEPRECATED: This setting is no longer used. npm stores temporary files in a
special location in the cache, and they are managed by
[\`cacache\`](http://npm.im/cacache).
Historically, the location where temporary files were stored. No longer
relevant.
`

exports[`test/lib/docs.js TAP config > all keys 1`] = `
Expand All @@ -2031,7 +2003,6 @@ Array [
"cafile",
"call",
"cert",
"ci-name",
"cidr",
"color",
"commit-hooks",
Expand Down Expand Up @@ -2148,7 +2119,6 @@ Array [
"tag",
"tag-version-prefix",
"timing",
"tmp",
"umask",
"unicode",
"update-notifier",
Expand Down Expand Up @@ -2186,7 +2156,6 @@ Array [
"cafile",
"call",
"cert",
"ci-name",
"cidr",
"color",
"commit-hooks",
Expand Down Expand Up @@ -2314,7 +2283,6 @@ Array [
"node-options",
"prefix",
"timing",
"tmp",
"update-notifier",
"usage",
"userconfig",
Expand Down Expand Up @@ -2343,7 +2311,6 @@ Object {
"call": "",
"cert": null,
"cidr": null,
"ciName": "{ci}",
"color": false,
"commitHooks": true,
"defaultTag": "latest",
Expand All @@ -2367,7 +2334,6 @@ Object {
"gitTagVersion": true,
"global": false,
"globalconfig": "{CWD}/global/etc/npmrc",
"hashAlgorithm": "sha1",
"heading": "npm",
"httpsProxy": null,
"ifPresent": false,
Expand Down
11 changes: 0 additions & 11 deletions test/fixtures/sandbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ const _get = Symbol('sandbox.proxy.get')
const _set = Symbol('sandbox.proxy.set')
const _logs = Symbol('sandbox.logs')

// these config keys can be redacted widely
const redactedDefaults = [
'tmp',
]

// we can't just replace these values everywhere because they're known to be
// very short strings that could be present all over the place, so we only
// replace them if they're located within quotes for now
Expand Down Expand Up @@ -161,12 +156,6 @@ class Sandbox extends EventEmitter {
// and we replaced the node version first, the real execPath we're trying
// to replace would no longer be represented, and be missed.
if (this[_npm]) {
// replace default config values with placeholders
for (const name of redactedDefaults) {
const value = this[_npm].config.defaults[name]
clean = clean.split(normalize(value)).join(`{${name.toUpperCase()}}`)
}

// replace vague default config values that are present within quotes
// with placeholders
for (const name of vagueRedactedDefaults) {
Expand Down

0 comments on commit d2c3712

Please sign in to comment.