Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{dryRun: true} not working with Sync mode #122

Closed
pjebs opened this issue Apr 16, 2020 · 3 comments
Closed

{dryRun: true} not working with Sync mode #122

pjebs opened this issue Apr 16, 2020 · 3 comments

Comments

@pjebs
Copy link

pjebs commented Apr 16, 2020

No description provided.

@sindresorhus
Copy link
Owner

We have a test for it:

del/test.js

Lines 99 to 110 in 4acd962

test('don\'t delete files, but return them - sync', t => {
const deletedFiles = del.sync(['*.tmp', '!1*'], {
cwd: t.context.tmp,
dryRun: true
});
exists(t, ['1.tmp', '2.tmp', '3.tmp', '4.tmp', '.dot.tmp']);
t.deepEqual(deletedFiles, [
path.join(t.context.tmp, '2.tmp'),
path.join(t.context.tmp, '3.tmp'),
path.join(t.context.tmp, '4.tmp')
]);
});

@pjebs
Copy link
Author

pjebs commented Apr 16, 2020

I needed to force: true too. In dryRun, why is that required?

@sindresorhus
Copy link
Owner

I assume it was because the path was outside the cwd. A dry-run should work like the real operation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants