Options
All
  • Public
  • Public/Protected
  • All
Menu

Package acceptance-tests

Namespaces

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

Assertions

Assertions: object

Type declaration

  • Optional fail?: Array<[]>
  • Optional pass?: Array<[]>

ExecResult

ExecResult: object | ExecException & object

Manifest

Manifest: object

Type declaration

  • Optional exports?: string | object
  • Optional main?: undefined | string
  • name: string

PackageEntry

PackageEntry: Map<string, object>

PackageRegistry

PackageRegistry: Map<string, PackageEntry>

PackageRunDriver

PackageRunDriver: function

Type declaration

Request

Request: object | object | object | object | object | object

Run

Run: function

Type declaration

    • (...args: Array<string> | []): Promise<ExecResult>
    • Parameters

      • Rest ...args: Array<string> | []

      Returns Promise<ExecResult>

RunFunction

RunFunction: function

Type declaration

    • (__namedParameters: object): void
    • Parameters

      • __namedParameters: object
        • path: string & object
        • run: function
            • (...args: Array<string> | []): Promise<ExecResult>
            • Parameters

              • Rest ...args: Array<string> | []

              Returns Promise<ExecResult>

        • source: function
            • (script: string, callDefinition?: Record<string, any>): Promise<Record<string, any>>
            • Parameters

              • script: string
              • Optional callDefinition: Record<string, any>

              Returns Promise<Record<string, any>>

      Returns void

Source

Source: function

Type declaration

    • (script: string, callDefinition?: Record<string, any>): Promise<Record<string, any>>
    • Parameters

      • script: string
      • Optional callDefinition: Record<string, any>

      Returns Promise<Record<string, any>>

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_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 NO_DEPS_PATCH

NO_DEPS_PATCH: "diff --git a/index.js b/index.jsindex bb9c6f687..5b141d3df 100644--- a/index.js+++ b/index.js@@ -1,5 +1,7 @@module.exports = require(`./package.json`);+module.exports.hello = `world`;+for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) {for (const dep of Object.keys(module.exports[key] || {})) {module.exports[key][dep] = require(dep);" = `diff --git a/index.js b/index.jsindex bb9c6f687..5b141d3df 100644--- a/index.js+++ b/index.js@@ -1,5 +1,7 @@module.exports = require(\`./package.json\`);+module.exports.hello = \`world\`;+for (const key of [\`dependencies\`, \`devDependencies\`, \`peerDependencies\`]) {for (const dep of Object.keys(module.exports[key] || {})) {module.exports[key][dep] = require(dep);`

Const PATCH_NAME

PATCH_NAME: string & object = `my-patch.patch` as Filename

Const SPEC_RC_FILENAME

SPEC_RC_FILENAME: string & object = `.spec-yarnrc` as Filename

Const SPEC_RC_FILENAME

SPEC_RC_FILENAME: string & object = `.spec-yarnrc` as Filename

Const configs

configs: object[] = [{nodeLinker: `pnp`,}, {nodeLinker: `pnpm`,}, {nodeLinker: `node-modules`,}]

createTemporaryFolder

createTemporaryFolder: any

Const deepResolve

deepResolve: any = require(`super-resolve`)

Const deepResolve

deepResolve: any = require(`super-resolve`)

exec

exec: object

Type declaration

  • execFile: any

execFile

execFile: execFile

execFile

execFile: any

Const execP

execP: __promisify__ = util.promisify(execFile)

fs

fs: object

Type declaration

  • readJson: any
  • writeFile: any
  • writeJson: any

fs

fs: object

Type declaration

  • writeFile: any
  • writeJson: any

fs

fs: object

Type declaration

  • createTemporaryFolder: any
  • readFile: any
  • walk: any

fs

fs: object

Type declaration

  • readJson: any

generatePkgDriver

generatePkgDriver: generatePkgDriver

getPackageDirectoryPath

getPackageDirectoryPath: any

getPackageDirectoryPath

getPackageDirectoryPath: any

getPackageRegistry

getPackageRegistry: getPackageRegistry

Const globalName

globalName: string = makeTemporaryEnv.getPackageManagerName()

Let httpsCertificates

httpsCertificates: object

Type declaration

  • ca: CertificateCreationResult
  • server: CertificateCreationResult

Const lockfile100

lockfile100: string = `# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.# yarn lockfile v1no-deps@*:version "1.0.0"resolved "https://registry.yarnpkg.com/no-deps/-/no-deps-1.0.0.tgz#39453512f8241e2d20307975e8d9eb6314f7bf61"integrity sha1-OUU1EvgkHi0gMHl16NnrYxT3v2E=`.replace(/^\n+/g, ``)

Const lockfile200

lockfile200: string = `# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.# yarn lockfile v1no-deps@*:version "2.0.0"resolved "https://registry.yarnpkg.com/no-deps/-/no-deps-2.0.0.tgz#39453512f8241e2d20307975e8d9eb6314f7bf62"integrity sha1-OUU1EvgkHi0gMHl16NnrYxT3v2E=`.replace(/^\n+/g, ``)

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 nativeHomePath = npath.dirname(nativePath);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`]: nativeHomePath,[`USERPROFILE`]: nativeHomePath,[`PATH`]: `${nativePath}/bin${delimiter}${process.env.PATH}`,[`YARN_IS_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 output isn't stable between runs[`YARN_ENABLE_TIMERS`]: `false`,[`YARN_ENABLE_PROGRESS_BARS`]: `false`,[`FORCE_COLOR`]: `0`,// Otherwise the output wouldn't be the same on CI vs non-CI[`YARN_ENABLE_INLINE_BUILDS`]: `false`,[`YARN_PREFER_AGGREGATE_CACHE_INFO`]: `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`,// Older versions of Windows need this set to not have node throw an error[`NODE_SKIP_PLATFORM_CHECK`]: `1`,...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

packageRegistryPromise: Promise<PackageRegistry> | null = null

parseSyml

parseSyml: any

readFile

readFile: any

readFile

readFile: readFile

readJson

readJson: any

readJson

readJson: any

readManifest

readManifest: any

readManifest

readManifest: readManifest

readManifest

readManifest: readManifest

readManifest

readManifest: readManifest

Let recording

recording: Array<Request> | null = null

setPackageWhitelist

setPackageWhitelist: any

setPackageWhitelist

setPackageWhitelist: setPackageWhitelist

startPackageServer

startPackageServer: startPackageServer

startPackageServer

startPackageServer: any

Const staticServer

staticServer: Handler = serveStatic(npath.fromPortablePath(require(`pkg-tests-fixtures`)))

testIf

testIf: any

tests

tests: object

Type declaration

  • setPackageWhitelist: any

tests

tests: object

Type declaration

  • testIf: any

tests

tests: object

Type declaration

  • getPackageDirectoryPath: any

tests

tests: object

Type declaration

  • validLogins: any

tests

tests: object

Type declaration

  • startPackageServer: any
  • validLogins: any

tests

tests: object

Type declaration

  • getPackageDirectoryPath: any

unpackToDirectory

unpackToDirectory: unpackToDirectory

Const validLogins

validLogins: object = {fooUser: new Login(`foo-user`),barUser: new Login(`bar-user`),otpUser: new Login(`otp-user`, {otp: true}),otpUserWithNotice: new Login(`otp-user-with-notice`, {otp: true, notice: true}),} as const

Type declaration

validLogins

validLogins: any

validLogins

validLogins: any

walk

walk: any

Let whitelist

whitelist: Map<any, any> = new Map()

writeConfiguration

writeConfiguration: writeConfiguration

writeFile

writeFile: any

writeFile

writeFile: any

writeFile

writeFile: writeFile

writeJson

writeJson: any

writeJson

writeJson: any

writeJson

writeJson: writeJson

writeJson

writeJson: writeJson

yarn

yarn: object

Type declaration

  • readManifest: any

Const yarnrcRegexp

yarnrcRegexp: RegExp = /^yarnPath:/

Functions

check

Const chmod

cleanupFileContent

  • cleanupFileContent(fileContent: string): string

computeCacheSize

Const createTemporaryFile

Const createTemporaryFolder

Const execFile

Const filePatternMatch

  • filePatternMatch(filePath: string, patterns: Array<string>, __namedParameters?: object): boolean

Const generatePkgDriver

Const getHttpsCertificates

  • getHttpsCertificates(): Promise<object>

Const getPackageArchiveHash

  • getPackageArchiveHash(name: string, version: string): Promise<string | Buffer>

Const getPackageArchivePath

  • getPackageArchivePath(name: string, version: string): Promise<string>

Const getPackageArchiveStream

  • getPackageArchiveStream(name: string, version: string): Promise<Gzip>

Const getPackageDirectoryPath

  • getPackageDirectoryPath(name: string, version: string): Promise<string>

Const getPackageEntry

  • getPackageEntry(name: string): Promise<PackageEntry | undefined>

Const getPackageHttpArchivePath

  • getPackageHttpArchivePath(name: string, version: string): Promise<string>

Const getPackageRegistry

getPluginPath

  • getPluginPath(dir: PortablePath, name: string): string & object

Const getWorkspaces

  • getWorkspaces(run: tests.Run): Promise<string[]>

Const lsStore

Const makeCodeFilter

  • makeCodeFilter(level: string): string

Const makeFakeBinary

  • makeFakeBinary(target: PortablePath, __namedParameters?: object): Promise<void>

Const makePatternFilter

  • makePatternFilter(level: string): string

makeTemporaryExportsEnv

  • makeTemporaryExportsEnv(testPackageName: string, manifest: Omit<Manifest, "name">, files: Array<string>, __namedParameters: object): any

Const makeTextFilter

  • makeTextFilter(level: string): string

Const mkdirp

Const mtme

  • mtme(packageJson: Record<string, any>, workspaces: Record<string, Record<string, any>>, subDefinition: Record<string, any> | RunFunction, fn?: RunFunction | undefined): any

Const packToFile

Const packToStream

  • packToStream(source: PortablePath, __namedParameters?: object): Gzip

Const parseJsonStream

  • parseJsonStream(stream: string, key?: undefined | string): any

readConfiguration

  • readConfiguration(dir: PortablePath, __namedParameters?: object): Promise<any>

Const readFile

  • readFile(source: PortablePath, encoding?: undefined | string): Promise<any>

Const readJson

readManifest

  • readManifest(dir: PortablePath, __namedParameters?: object): Promise<any>
  • Parameters

    • dir: PortablePath
    • Default value __namedParameters: object = {}
      • filename: string & object
      • key: undefined | "name" | "version" | "dependencies" | "peerDependencies" | "dependenciesMeta" | "peerDependenciesMeta" | "type" | "devDependencies" | "os" | "cpu" | "libc" | "indent" | "packageManager" | "private" | "license" | "main" | "module" | "browser" | "languageName" | "bin" | "scripts" | "workspaceDefinitions" | "resolutions" | "files" | "publishConfig" | "installConfig" | "preferUnplugged" | "raw" | "errors" | "loadFromText" | "loadFile" | "load" | "getForScope" | "hasConsumerDependency" | "hasHardDependency" | "hasSoftDependency" | "hasDependency" | "getConditions" | "isCompatibleWithOS" | "isCompatibleWithCPU" | "ensureDependencyMeta" | "ensurePeerDependencyMeta" | "setRawField" | "exportTo"

    Returns Promise<any>

Const readSyml

Const realpath

Const setPackageWhitelist

  • setPackageWhitelist(packages: Map<string, Set<string>>, fn: function): Promise<void>

Const startPackageServer

  • startPackageServer(__namedParameters?: object): Promise<string>

Const startRegistryRecording

  • startRegistryRecording(fn: function): Promise<(object | object | object | object | object | object)[]>

Const stringPatternMatch

  • stringPatternMatch(string: string, patterns: Array<string>, __namedParameters?: object): boolean

Const testIf

  • testIf(condition: function, name: string, execute?: jest.ProvidesCallback | undefined, timeout?: number | undefined): void

Const unpackToDirectory

Const walk

writeConfiguration

  • writeConfiguration(dir: PortablePath, value: object, __namedParameters?: object): Promise<void>

Const writeFile

  • writeFile(target: PortablePath, body: string | Buffer): Promise<void>

Const writeJson

  • writeJson(target: PortablePath, object: any): Promise<void>

writeManifest

  • writeManifest(dir: PortablePath, value: object, __namedParameters?: object): Promise<void>

writePackage

  • writePackage(dir: PortablePath, manifest: object): Promise<void>

Const writeSyml

  • writeSyml(target: PortablePath, object: any): Promise<void>

writeTestPackage

Object literals

Const CLASSIC_SCOPE_SETTINGS

CLASSIC_SCOPE_SETTINGS: object

npmAlwaysAuth

npmAlwaysAuth: string = `true`

Const FAKE_REGISTRY_CREDENTIALS

FAKE_REGISTRY_CREDENTIALS: object

npmAuthIdent

npmAuthIdent: string = `username:password`

npmAuthToken

npmAuthToken: string = `ffffffff-ffff-ffff-ffff-ffffffffffff`

Const packageServerUrls

packageServerUrls: object

http

http: null = null

https

https: null = null

Const unplugged

unplugged: object

unplugged

unplugged: boolean = true

Generated using TypeDoc