Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow packageManager to be specified by name alone#300

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
rotu wants to merge9 commits intonodejs:main
base:main
Choose a base branch
Loading
fromrotu:poised-ermine
Open
Changes from1 commit
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
PrevPrevious commit
NextNext commit
update tests
  • Loading branch information
@rotu
rotu committedOct 9, 2023
commit6cf4ea9bbe0cf0d2f2ed04c3b00007ba1b1fe38c
29 changes: 18 additions & 11 deletionstests/main.test.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,36 +29,39 @@ it(`should refuse to download a package manager if the hash doesn't match`, asyn
});
});

it(`shouldrequire a versionto be specified`, async () => {
it(`shouldreify afuzzyversionfrom package.json`, async () => {
await xfs.mktempPromise(async cwd => {
await xfs.writeJsonPromise(ppath.join(cwd, `package.json` as Filename), {
packageManager: `yarn`,
});

await expect(runCli(cwd, [`yarn`, `--version`])).resolves.toMatchObject({
exitCode: 1,
stderr: ``,
stdout: /expected a semver version/,
exitCode: 0,
stdout: /\d+\.\d+\.\d+/,
});

await expect(xfs.readJsonPromise(ppath.join(cwd, `package.json` as Filename))).resolves.toMatchObject({
packageManager: `yarn`,
});

await xfs.writeJsonPromise(ppath.join(cwd, `package.json` as Filename), {
packageManager: `yarn@stable`,
});

await expect(runCli(cwd, [`yarn`, `--version`])).resolves.toMatchObject({
exitCode: 1,
stderr: ``,
stdout: /expected a semver version/,
exitCode: 0,
stdout: /\d+\.\d+\.\d+/,
});

await xfs.writeJsonPromise(ppath.join(cwd, `package.json` as Filename), {
packageManager: `yarn@^1.0.0`,
});

await expect(xfs.readJsonPromise(ppath.join(cwd, `package.json` as Filename))).resolves.toMatchObject({
packageManager: /yarn@1\.\d+\.\d+/,
});
await expect(runCli(cwd, [`yarn`, `--version`])).resolves.toMatchObject({
exitCode: 1,
stderr: ``,
stdout: /expected a semver version/,
exitCode: 0,
stdout: /1\.\d+\.\d+/,
});
});
});
Expand DownExpand Up@@ -278,6 +281,10 @@ it(`should allow to call "corepack install" without arguments within a configure
stderr: ``,
});

await expect(xfs.readJsonPromise(ppath.join(cwd, `package.json` as Filename))).resolves.toMatchObject({
packageManager: /yarn@1.0.0\+sha256\./,
});

// Disable the network to make sure we don't succeed by accident
process.env.COREPACK_ENABLE_NETWORK = `0`;

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp