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

Path management: Fix xattr tests #7512

Merged
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('manageLinesInFile', () => {
});

describe('Target exists as a plain file', () => {
testUnix('Fails if file has extended attributes', async() => {
testUnix('Preserves extended attributes', async() => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- This only fails on Windows
// @ts-ignore // fs-xattr is not available on Windows.
const { get, list, set } = await import('fs-xattr');
Expand All @@ -74,7 +74,7 @@ describe('manageLinesInFile', () => {

await fs.promises.writeFile(rcFilePath, unmanagedContents);
await set(rcFilePath, attributeKey, attributeValue);
expect(manageLinesInFile(rcFilePath, [TEST_LINE_1], true)).rejects.toThrow();
await expect(manageLinesInFile(rcFilePath, [TEST_LINE_1], true)).resolves.not.toThrow();
await expect(list(rcFilePath)).resolves.toEqual([attributeKey]);
await expect(get(rcFilePath, attributeKey)).resolves.toEqual(Buffer.from(attributeValue, 'utf-8'));
});
Expand Down
Loading