Skip to content

Commit

Permalink
Prettier (#24966)
Browse files Browse the repository at this point in the history
### Packages impacted by this PR


### Issues associated with this PR


### Describe the problem that is addressed by this PR


### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?


### Are there test cases added in this PR? _(If not, why?)_


### Provide a list of related PRs _(if any)_


### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
  • Loading branch information
EmmaZhu authored Feb 23, 2023
1 parent 342f222 commit adef2d3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
6 changes: 3 additions & 3 deletions sdk/storage/storage-file-datalake/test/pathclient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe("DataLakePathClient", () => {

assert.ok(foundFile, "The file should have been created.");
});

it("DataLakeDirectoryClient create directory path with directory dots", async () => {
const subDirName = recorder.getUniqueName("dirname");
const subDirNameWithDots = "./adir/.././anotherdir/.././" + subDirName;
Expand Down Expand Up @@ -93,7 +93,7 @@ describe("DataLakePathClient", () => {
await fileClientWithDirDots.create();

let foundFile: boolean = false;
for await (const listedFile of fileSystemClient.listPaths({path: dirName})) {
for await (const listedFile of fileSystemClient.listPaths({ path: dirName })) {
if (listedFile.name === `${dirName}/${fileBaseName}` && !listedFile.isDirectory) {
foundFile = true;
}
Expand Down Expand Up @@ -129,7 +129,7 @@ describe("DataLakePathClient", () => {
await dirClientWithDirDots.create();

let foundSubDir: boolean = false;
for await (const listedFile of fileSystemClient.listPaths({path: dirName})) {
for await (const listedFile of fileSystemClient.listPaths({ path: dirName })) {
if (listedFile.name === `${dirName}/${subDirBaseName}` && listedFile.isDirectory) {
foundSubDir = true;
}
Expand Down
24 changes: 16 additions & 8 deletions sdk/storage/storage-file-share/test/fileclient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ describe("FileClient", () => {
await fileClientWithDirDots.create(content.length);

let foundFile = false;
for await (const fileItem of dirClient.listFilesAndDirectories({prefix: fileBaseName})){
for await (const fileItem of dirClient.listFilesAndDirectories({ prefix: fileBaseName })) {
if (fileItem.name === fileBaseName && fileItem.kind === "file") {
foundFile = true;
}
Expand All @@ -187,13 +187,17 @@ describe("FileClient", () => {
assert.ok(foundFile, "The file should have been created.");

await fileClientWithDirDots.delete();

const fileShouldInRootDir = "./a/../../" + fileBaseName;
const fileClientShouldInRootDir = shareClient.getDirectoryClient("anydir").getFileClient(fileShouldInRootDir);
const fileClientShouldInRootDir = shareClient
.getDirectoryClient("anydir")
.getFileClient(fileShouldInRootDir);
await fileClientShouldInRootDir.create(content.length);

foundFile = false;
for await (const fileItem of shareClient.getDirectoryClient("").listFilesAndDirectories({prefix: fileBaseName})){
for await (const fileItem of shareClient
.getDirectoryClient("")
.listFilesAndDirectories({ prefix: fileBaseName })) {
if (fileItem.name === fileBaseName && fileItem.kind === "file") {
foundFile = true;
}
Expand All @@ -211,7 +215,7 @@ describe("FileClient", () => {
await dirClientWithDirDots.create();

let foundDir = false;
for await (const fileItem of dirClient.listFilesAndDirectories({prefix: dirBaseName})){
for await (const fileItem of dirClient.listFilesAndDirectories({ prefix: dirBaseName })) {
if (fileItem.name === dirBaseName && fileItem.kind === "directory") {
foundDir = true;
}
Expand All @@ -220,13 +224,17 @@ describe("FileClient", () => {
assert.ok(foundDir, "The directory should have been created.");

await dirClientWithDirDots.delete();

const dirShouldInRootDir = "./a/../../" + dirBaseName;
const dirClientShouldInRootDir = shareClient.getDirectoryClient("anydir").getDirectoryClient(dirShouldInRootDir);
const dirClientShouldInRootDir = shareClient
.getDirectoryClient("anydir")
.getDirectoryClient(dirShouldInRootDir);
await dirClientShouldInRootDir.create();

foundDir = false;
for await (const fileItem of shareClient.getDirectoryClient("").listFilesAndDirectories({prefix: dirBaseName})){
for await (const fileItem of shareClient
.getDirectoryClient("")
.listFilesAndDirectories({ prefix: dirBaseName })) {
if (fileItem.name === dirBaseName && fileItem.kind === "directory") {
foundDir = true;
}
Expand Down

0 comments on commit adef2d3

Please sign in to comment.