Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 3 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,9 @@
"postinstall": "preconstruct dev && NODE_OPTIONS=--experimental-strip-types packages/cli/bin.js check",
"knip": "knip",
"release": "preconstruct build && changeset publish",
"test": "jest",
"test": "vitest",
"test-gatsby": "cd test-gatsby && gatsby develop"
},
"jest": {
"watchPlugins": [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname"
]
},
"devDependencies": {
"@babel/core": "^7.20.5",
"@babel/plugin-transform-runtime": "^7.19.6",
Expand All @@ -30,16 +24,14 @@
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.0",
"@preconstruct/cli": "^2.8.12",
"@types/jest": "^29.2.4",
"@types/normalize-path": "^3.0.0",
"@types/parse-github-url": "^1.0.0",
"@types/semver": "^6.0.1",
"jest": "^29.3.1",
"jest-watch-typeahead": "^2.2.1",
"knip": "^5.33.3",
"prettier": "^3.5.3",
"prettier-plugin-packagejson": "^2.5.10",
"typescript": "^5.3.2"
"typescript": "^5.3.2",
"vitest": "^3.1.2"
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
"preconstruct": {
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"@changesets/types": "^5.2.1",
"@types/validate-npm-package-name": "^4.0.2",
"fixturez": "^1.1.0",
"strip-ansi": "^6.0.0"
"strip-ansi": "^6.0.0",
"vitest": "^3.1.2"
},
"engines": {
"node": ">=18.0.0"
Expand Down
50 changes: 25 additions & 25 deletions packages/cli/src/__snapshots__/run.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,131 +1,131 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Run command should execute "@manypkg/basic-fixture-pkg-two start" and exit with 0: stderr 1`] = `
exports[`Run command > should execute "@manypkg/basic-fixture-pkg-two start" and exit with 0 > stderr 1`] = `
"warning package.json: No license field
warning ../../package.json: No license field
"
`;

exports[`Run command should execute "@manypkg/basic-fixture-pkg-two start" and exit with 0: stdout 1`] = `
exports[`Run command > should execute "@manypkg/basic-fixture-pkg-two start" and exit with 0 > stdout 1`] = `
"$ echo hello start
hello start
"
`;

exports[`Run command should execute "package start" and exit with 1: stderr 1`] = `
exports[`Run command > should execute "package start" and exit with 1 > stderr 1`] = `
"☔️ error an identifier must only match a single package but "package" matches the following packages:
☔️ error @manypkg/basic-fixture-pkg-one
☔️ error @manypkg/basic-fixture-pkg-two
☔️ error @manypkg/basic-fixture-pkg-two-one
"
`;

exports[`Run command should execute "package start" and exit with 1: stdout 1`] = `""`;
exports[`Run command > should execute "package start" and exit with 1 > stdout 1`] = `""`;

exports[`Run command should execute "package-one start" and exit with 0: stderr 1`] = `
exports[`Run command > should execute "package-one start" and exit with 0 > stderr 1`] = `
"warning package.json: No license field
warning ../../package.json: No license field
"
`;

exports[`Run command should execute "package-one start" and exit with 0: stdout 1`] = `
exports[`Run command > should execute "package-one start" and exit with 0 > stdout 1`] = `
"$ echo hello start
hello start
"
`;

exports[`Run command should execute "package-one test" and exit with 0: stderr 1`] = `
exports[`Run command > should execute "package-one test" and exit with 0 > stderr 1`] = `
"warning package.json: No license field
warning ../../package.json: No license field
"
`;

exports[`Run command should execute "package-one test" and exit with 0: stdout 1`] = `
exports[`Run command > should execute "package-one test" and exit with 0 > stdout 1`] = `
"$ echo testing
testing
"
`;

exports[`Run command should execute "package-three start" and exit with 1: stderr 1`] = `
exports[`Run command > should execute "package-three start" and exit with 1 > stderr 1`] = `
"☔️ error No matching packages found
"
`;

exports[`Run command should execute "package-three start" and exit with 1: stdout 1`] = `""`;
exports[`Run command > should execute "package-three start" and exit with 1 > stdout 1`] = `""`;

exports[`Run command should execute "package-two start" and exit with 1: stderr 1`] = `
exports[`Run command > should execute "package-two start" and exit with 1 > stderr 1`] = `
"☔️ error an identifier must only match a single package but "package-two" matches the following packages:
☔️ error @manypkg/basic-fixture-pkg-two
☔️ error @manypkg/basic-fixture-pkg-two-one
"
`;

exports[`Run command should execute "package-two start" and exit with 1: stdout 1`] = `""`;
exports[`Run command > should execute "package-two start" and exit with 1 > stdout 1`] = `""`;

exports[`Run command should execute "package-two-one something" and exit with 1: stderr 1`] = `
exports[`Run command > should execute "package-two-one something" and exit with 1 > stderr 1`] = `
"warning package.json: No license field
warning ../../package.json: No license field
error Command "something" not found.
"
`;

exports[`Run command should execute "package-two-one something" and exit with 1: stdout 1`] = `
exports[`Run command > should execute "package-two-one something" and exit with 1 > stdout 1`] = `
"info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
"
`;

exports[`Run command should execute "package-two-one start" and exit with 0: stderr 1`] = `
exports[`Run command > should execute "package-two-one start" and exit with 0 > stderr 1`] = `
"warning package.json: No license field
warning ../../package.json: No license field
"
`;

exports[`Run command should execute "package-two-one start" and exit with 0: stdout 1`] = `
exports[`Run command > should execute "package-two-one start" and exit with 0 > stdout 1`] = `
"$ echo hello start
hello start
"
`;

exports[`Run command should execute "packages/package-two start" and exit with 0: stderr 1`] = `
exports[`Run command > should execute "packages/package-two start" and exit with 0 > stderr 1`] = `
"warning package.json: No license field
warning ../../package.json: No license field
"
`;

exports[`Run command should execute "packages/package-two start" and exit with 0: stdout 1`] = `
exports[`Run command > should execute "packages/package-two start" and exit with 0 > stdout 1`] = `
"$ echo hello start
hello start
"
`;

exports[`Run command should execute "pkg-one start" and exit with 0: stderr 1`] = `
exports[`Run command > should execute "pkg-one start" and exit with 0 > stderr 1`] = `
"warning package.json: No license field
warning ../../package.json: No license field
"
`;

exports[`Run command should execute "pkg-one start" and exit with 0: stdout 1`] = `
exports[`Run command > should execute "pkg-one start" and exit with 0 > stdout 1`] = `
"$ echo hello start
hello start
"
`;

exports[`Run command should execute "pkg-two start" and exit with 1: stderr 1`] = `
exports[`Run command > should execute "pkg-two start" and exit with 1 > stderr 1`] = `
"☔️ error an identifier must only match a single package but "pkg-two" matches the following packages:
☔️ error @manypkg/basic-fixture-pkg-two
☔️ error @manypkg/basic-fixture-pkg-two-one
"
`;

exports[`Run command should execute "pkg-two start" and exit with 1: stdout 1`] = `""`;
exports[`Run command > should execute "pkg-two start" and exit with 1 > stdout 1`] = `""`;

exports[`Run command should execute "pkg-two-one start" and exit with 0: stderr 1`] = `
exports[`Run command > should execute "pkg-two-one start" and exit with 0 > stderr 1`] = `
"warning package.json: No license field
warning ../../package.json: No license field
"
`;

exports[`Run command should execute "pkg-two-one start" and exit with 0: stdout 1`] = `
exports[`Run command > should execute "pkg-two-one start" and exit with 0 > stdout 1`] = `
"$ echo hello start
hello start
"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect, it } from "vitest";
import internalMismatch from "../EXTERNAL_MISMATCH.ts";
import { getWS, getFakeWS, getRootWS } from "../../test-helpers.ts";
import { getWS, getFakeWS, getRootWS } from "./test-helpers.ts";

let rootWorkspace = getRootWS();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import {
getFakeString,
getFakeWS,
getRootWS,
getWS,
} from "../../test-helpers.ts";
import { describe, expect, it } from "vitest";
import { getFakeString, getFakeWS, getRootWS, getWS } from "./test-helpers.ts";
import check from "../INCORRECT_REPOSITORY_FIELD.ts";

describe("incorrect repository field", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { getFakeWS, getRootWS, getWS } from "../../test-helpers.ts";
import { describe, expect, it } from "vitest";
import { getFakeWS, getRootWS, getWS } from "./test-helpers.ts";
import makeCheck, { ErrorType } from "../INTERNAL_MISMATCH.ts";

let rootWorkspace = getRootWS();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { getFakeWS, getRootWS, getWS } from "../../test-helpers.ts";
import { describe, expect, it } from "vitest";
import { getFakeWS, getRootWS, getWS } from "./test-helpers.ts";
import makeCheck from "../INVALID_DEV_AND_PEER_DEPENDENCY_RELATIONSHIP.ts";

let rootWorkspace = getRootWS();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { getFakeWS, getRootWS, getWS } from "../../test-helpers.ts";
import { expect, test } from "vitest";
import { getFakeWS, getRootWS, getWS } from "./test-helpers.ts";
import makeCheck from "../WORKSPACE_REQUIRED.ts";
let rootWorkspace = getRootWS();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
// These are utils for testing.
// I wanted to put this in the test folder but then jest tested it
// Easier to put it here than add to jest ignore but maybe wrong.
//
// Who can say? ¯\_(ツ)_/¯

import { Package } from "@manypkg/get-packages";
import crypto from "node:crypto";

Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/run.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, expect, it } from "vitest";
import fixturez from "fixturez";
import stripAnsi from "strip-ansi";
import { exec } from "tinyexec";
Expand Down
3 changes: 2 additions & 1 deletion packages/find-root/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
},
"devDependencies": {
"@types/node": "^16.11.7",
"fixturez": "^1.1.0"
"fixturez": "^1.1.0",
"vitest": "^3.1.2"
},
"engines": {
"node": ">=14.18.0"
Expand Down
1 change: 1 addition & 0 deletions packages/find-root/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, expect, test } from "vitest";
import fixturez from "fixturez";
import path from "node:path";
import { findRoot, findRootSync } from "./index.ts";
Expand Down
3 changes: 2 additions & 1 deletion packages/get-packages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"@manypkg/tools": "^1.1.1"
},
"devDependencies": {
"fixturez": "^1.1.0"
"fixturez": "^1.1.0",
"vitest": "^3.1.2"
},
"engines": {
"node": ">=14.18.0"
Expand Down
1 change: 1 addition & 0 deletions packages/get-packages/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, expect, it } from "vitest";
import fixturez from "fixturez";
import path from "node:path";
import { getPackages, getPackagesSync } from "./index.ts";
Expand Down
Loading