Skip to content

Commit ec9034e

Browse files
committed
Fixes tests
1 parent 4333a68 commit ec9034e

File tree

7 files changed

+8
-38
lines changed

7 files changed

+8
-38
lines changed

.yarn/versions/bbd4868b.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ declined:
99
- "@yarnpkg/plugin-compat"
1010
- "@yarnpkg/plugin-dlx"
1111
- "@yarnpkg/plugin-essentials"
12+
- "@yarnpkg/plugin-exec"
1213
- "@yarnpkg/plugin-init"
1314
- "@yarnpkg/plugin-nm"
1415
- "@yarnpkg/plugin-npm-cli"

packages/acceptance-tests/pkg-tests-specs/sources/commands/stage.test.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ describe(`Commands`, () => {
1010
`it should stage the initial files`,
1111
makeTemporaryEnv({}, async ({path, run, source}) => {
1212
await execFile(`git`, [`init`], {cwd: path});
13-
await writeFile(`${path}/.yarnrc.yml`, `plugins:\n - ${JSON.stringify(require.resolve(`@yarnpkg/monorepo/scripts/plugin-stage.js`))}\n`);
1413

1514
await expect(run(`stage`, `-n`, {cwd: path})).resolves.toMatchObject({
1615
stdout: [
@@ -25,7 +24,6 @@ describe(`Commands`, () => {
2524
`it should not stage non-yarn files`,
2625
makeTemporaryEnv({}, async ({path, run, source}) => {
2726
await execFile(`git`, [`init`], {cwd: path});
28-
await writeFile(`${path}/.yarnrc.yml`, `plugins:\n - ${JSON.stringify(require.resolve(`@yarnpkg/monorepo/scripts/plugin-stage.js`))}\n`);
2927

3028
await writeFile(`${path}/index.js`, `module.exports = 42;\n`);
3129

@@ -48,7 +46,6 @@ describe(`Commands`, () => {
4846
await run(`install`);
4947

5048
await execFile(`git`, [`init`], {cwd: path});
51-
await writeFile(`${path}/.yarnrc.yml`, `plugins:\n - ${JSON.stringify(require.resolve(`@yarnpkg/monorepo/scripts/plugin-stage.js`))}\n`);
5249

5350
await expect(run(`stage`, `-n`, {cwd: path})).resolves.toMatchObject({
5451
stdout: [
@@ -74,7 +71,6 @@ describe(`Commands`, () => {
7471
},
7572
}, async ({path, run, source}) => {
7673
await execFile(`git`, [`init`], {cwd: path});
77-
await writeFile(`${path}/.yarnrc.yml`, `plugins:\n - ${JSON.stringify(require.resolve(`@yarnpkg/monorepo/scripts/plugin-stage.js`))}\n`);
7874

7975
// Otherwise we can't always commit
8076
await execFile(`git`, [`config`, `user.name`, `John Doe`], {cwd: path});

packages/acceptance-tests/pkg-tests-specs/sources/commands/workspace.test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
const {
2-
fs: {writeFile, writeJson},
2+
fs: {writeJson},
33
} = require(`pkg-tests-core`);
44

55

66
async function setupWorkspaces(path) {
7-
await writeFile(`${path}/.yarnrc.yml`, `plugins:\n - ${JSON.stringify(require.resolve(`@yarnpkg/monorepo/scripts/plugin-workspace-tools.js`))}\n`);
8-
97
await writeJson(`${path}/docs/package.json`, {
108
name: `docs`,
119
version: `1.0.0`,

packages/acceptance-tests/pkg-tests-specs/sources/commands/workspaces/foreach.test.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ async function setupWorkspaces(path) {
77
await writeFile(`${path}/mutexes/workspace-a`, ``);
88
await writeFile(`${path}/mutexes/workspace-b`, ``);
99

10-
await writeFile(`${path}/.yarnrc.yml`, `plugins:\n - ${JSON.stringify(require.resolve(`@yarnpkg/monorepo/scripts/plugin-workspace-tools.js`))}\n`);
11-
1210
await writeFile(`${path}/packages/workspace-a/server.js`, getClientContent(`${path}/mutexes/workspace-a`, `PING`));
1311
await writeJson(`${path}/packages/workspace-a/package.json`, {
1412
name: `workspace-a`,
@@ -324,8 +322,6 @@ describe(`Commands`, () => {
324322
workspaces: [`packages/*`],
325323
},
326324
async ({path, run}) => {
327-
await writeFile(`${path}/.yarnrc.yml`, `plugins:\n - ${JSON.stringify(require.resolve(`@yarnpkg/monorepo/scripts/plugin-workspace-tools.js`))}\n`);
328-
329325
await writeJson(`${path}/packages/package-a/package.json`, {
330326
name: `workspace-a`,
331327
version: `1.0.0`,

packages/acceptance-tests/pkg-tests-specs/sources/plugins/plugin-typescript.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ describe(`Plugins`, () => {
306306
[type]: {
307307
[`@types/is-number`]: `1.0.0`,
308308
},
309+
}, {
310+
tsEnableAutoTypes: true,
309311
}), async ({path, run, source}) => {
310312
await run(`remove`, `is-number`);
311313

@@ -323,6 +325,8 @@ describe(`Plugins`, () => {
323325
devDependencies: {
324326
[`@types/iarna__toml`]: `1.0.0`,
325327
},
328+
}, {
329+
tsEnableAutoTypes: true,
326330
}, async ({path, run, source}) => {
327331
await run(`remove`, `@iarna/toml`);
328332

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,5 @@
11
// Don't modify this script directly! Instead, run:
22
// yarn build:plugin-commands
33

4-
export const pluginCommands = new Map([
5-
[`constraints`, [
6-
[`constraints`, `query`],
7-
[`constraints`, `source`],
8-
[`constraints`],
9-
]],
10-
[`exec`, [
11-
]],
12-
[`interactive-tools`, [
13-
[`search`],
14-
[`upgrade-interactive`],
15-
]],
16-
[`stage`, [
17-
[`stage`],
18-
]],
19-
[`typescript`, [
20-
]],
21-
[`version`, [
22-
[`version`, `apply`],
23-
[`version`, `check`],
24-
[`version`],
25-
]],
26-
[`workspace-tools`, [
27-
[`workspaces`, `focus`],
28-
[`workspaces`, `foreach`],
29-
]],
4+
export const pluginCommands = new Map<string, Array<string>>([
305
]);

scripts/gen-plugin-commands.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let output = ``;
1212
output += `// Don't modify this script directly! Instead, run:\n`;
1313
output += `// yarn build:plugin-commands\n`;
1414
output += `\n`;
15-
output += `export const pluginCommands = new Map([\n`;
15+
output += `export const pluginCommands = new Map<string, Array<string>>([\n`;
1616

1717
for (const name of folders) {
1818
if (!name.startsWith(`plugin-`))

0 commit comments

Comments
 (0)