Variables
Const FAKE_FIRST_SCOPE
FAKE_FIRST_SCOPE: "first" = `first`
Const FAKE_PUBLISH_REGISTRY_URL
FAKE_PUBLISH_REGISTRY_URL: "https://npm.pkg.github.com" = `https://npm.pkg.github.com`
Const FAKE_REGISTRY_URL
FAKE_REGISTRY_URL: "http://yarn.test.registry" = `http://yarn.test.registry`
Const FAKE_SECOND_SCOPE
FAKE_SECOND_SCOPE: "second" = `second`
Const FAKE_THIRD_REGISTRY_URL
FAKE_THIRD_REGISTRY_URL: "https://third.yarn.test.registry" = `https://third.yarn.test.registry`
Const FAKE_THIRD_SCOPE
FAKE_THIRD_SCOPE: "third" = `third`
Const IS_WIN32
IS_WIN32: boolean = process.platform === `win32`
Const SPEC_RC_FILENAME
SPEC_RC_FILENAME: string & object = `.spec-yarnrc` as Filename
Const deepResolve
deepResolve: any = require(`super-resolve`)
Const deepResolve
deepResolve: any = require(`super-resolve`)
fs
fs: object
Type declaration
-
writeFile: any
-
writeJson: any
Const mte
mte
: PackageDriver = generatePkgDriver({getName() {return `yarn`;},async runDriver(path,[command, ...args],{cwd, projectFolder, registryUrl, env, ...config},) {const rcEnv: Record<string, any> = {};for (const [key, value] of Object.entries(config))rcEnv[`YARN_${key.replace(/([A-Z])/g, `_$1`).toUpperCase()}`] = Array.isArray(value) ? value.join(`;`) : value;const nativePath = npath.fromPortablePath(path);const tempHomeFolder = npath.fromPortablePath(await createTemporaryFolder());const cwdArgs = typeof projectFolder !== `undefined`? [projectFolder]: [];const yarnBinary = require.resolve(`${__dirname}/../../../../yarnpkg-cli/bundles/yarn.js`);const res = await execFile(process.execPath, [yarnBinary, ...cwdArgs, command, ...args], {cwd: cwd || path,env: {[`HOME`]: tempHomeFolder,[`USERPROFILE`]: tempHomeFolder,[`PATH`]: `${nativePath}/bin${delimiter}${process.env.PATH}`,[`TEST_ENV`]: `true`,[`YARN_GLOBAL_FOLDER`]: `${nativePath}/.yarn/global`,[`YARN_NPM_REGISTRY_SERVER`]: registryUrl,[`YARN_UNSAFE_HTTP_WHITELIST`]: new URL(registryUrl).hostname,// Otherwise we'd send telemetry event when running tests[`YARN_ENABLE_TELEMETRY`]: `0`,// Otherwise snapshots relying on this would break each time it's bumped[`YARN_CACHE_KEY_OVERRIDE`]: `0`,// Otherwise the tests would break when C:\tmp is on a different drive than the repo[`YARN_ENABLE_ABSOLUTE_VIRTUALS`]: `true`,// Otherwise the output isn't stable between runs[`YARN_ENABLE_TIMERS`]: `false`,[`YARN_ENABLE_PROGRESS_BARS`]: `false`,// Otherwise the output wouldn't be the same on CI vs non-CI[`YARN_ENABLE_INLINE_BUILDS`]: `false`,// Otherwise we would more often test the fallback rather than the real logic[`YARN_PNP_FALLBACK_MODE`]: `none`,// Otherwise tests fail on systems where this is globally set to true[`YARN_ENABLE_GLOBAL_CACHE`]: `false`,...rcEnv,...env,},});if (process.env.JEST_LOG_SPAWNS) {console.log(`===== stdout:`);console.log(res.stdout);console.log(`===== stderr:`);console.log(res.stderr);}return res;},})
Let packageRegistryPromise
Let packageServerUrl
packageServerUrl: string | null = null
Const staticServer
staticServer: Handler = serveStatic(npath.fromPortablePath(require(`pkg-tests-fixtures`)))
Let whitelist
whitelist: Map<any, any> = new Map()