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
4 changes: 0 additions & 4 deletions .pnp.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .yarnrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ init-scope: berry

plugins:
- scripts/plugin-exec.js
- scripts/plugin-pack.js
- scripts/plugin-stage.js
- scripts/plugin-typescript.js

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,42 @@ describe(`Commands`, () => {

await run(`install`);

const {stdout} = await run(`pack`, `--list`);
const {stdout} = await run(`pack`, `--dry-run`);
await expect(stdout).toMatch(/index\.js/);
}),
);

test(
`it should only keep the files covered by the "files" field`,
makeTemporaryEnv({
files: [
`*.js`,
`/b.ts`,
],
}, async ({path, run, source}) => {
await fsUtils.writeFile(`${path}/a.js`, `module.exports = 42;\n`);
await fsUtils.writeFile(`${path}/b.js`, `module.exports = 42;\n`);
await fsUtils.writeFile(`${path}/a.ts`, `module.exports = 42;\n`);
await fsUtils.writeFile(`${path}/b.ts`, `module.exports = 42;\n`);

await run(`install`);

const {stdout} = await run(`pack`, `--dry-run`);
await expect(stdout).toMatch(/a\.js/);
await expect(stdout).toMatch(/b\.js/);
await expect(stdout).not.toMatch(/a\.ts/);
await expect(stdout).toMatch(/b\.ts/);
}),
);

test(
`it shouldn't add .gitignore files to the package files`,
makeTemporaryEnv({}, async ({path, run, source}) => {
await fsUtils.writeFile(`${path}/.gitignore`, ``);

await run(`install`);

const {stdout} = await run(`pack`, `--list`);
const {stdout} = await run(`pack`, `--dry-run`);
await expect(stdout).not.toMatch(/\.gitignore/);
}),
);
Expand All @@ -33,7 +56,7 @@ describe(`Commands`, () => {

await run(`install`);

const {stdout} = await run(`pack`, `--list`);
const {stdout} = await run(`pack`, `--dry-run`);
await expect(stdout).not.toMatch(/\.npmignore/);
}),
);
Expand All @@ -43,7 +66,7 @@ describe(`Commands`, () => {
makeTemporaryEnv({}, async ({path, run, source}) => {
await run(`install`);

const {stdout} = await run(`pack`, `--list`);
const {stdout} = await run(`pack`, `--dry-run`);
await expect(stdout).not.toMatch(/\.yarn\/cache/);
}),
);
Expand All @@ -53,7 +76,7 @@ describe(`Commands`, () => {
makeTemporaryEnv({}, async ({path, run, source}) => {
await run(`install`);

const {stdout} = await run(`pack`, `--list`);
const {stdout} = await run(`pack`, `--dry-run`);
await expect(stdout).not.toMatch(/yarn\.lock/);
}),
);
Expand All @@ -66,7 +89,7 @@ describe(`Commands`, () => {

await run(`install`);

const {stdout} = await run(`pack`, `--list`);
const {stdout} = await run(`pack`, `--dry-run`);
await expect(stdout).not.toMatch(/index\.js/);
}),
);
Expand All @@ -79,7 +102,7 @@ describe(`Commands`, () => {

await run(`install`);

const {stdout} = await run(`pack`, `--list`);
const {stdout} = await run(`pack`, `--dry-run`);
await expect(stdout).not.toMatch(/index\.js/);
}),
);
Expand All @@ -94,7 +117,7 @@ describe(`Commands`, () => {

await run(`install`);

const {stdout} = await run(`pack`, `--list`);
const {stdout} = await run(`pack`, `--dry-run`);
await expect(stdout).not.toMatch(/a\.js/);
await expect(stdout).toMatch(/b\.js/);
}),
Expand Down
Loading