Skip to content

Commit

Permalink
Add tests for #267
Browse files Browse the repository at this point in the history
  • Loading branch information
perry-mitchell committed Aug 14, 2021
1 parent 443c359 commit 5872383
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/node/operations/getFileContents.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,12 @@ describe("getFileContents", function() {
.to.have.property("headers")
.that.has.property("X-test", "test");
});

it("can retrieve JSON files as text (#267)", async function() {
const contents = await this.client.getFileContents("/format.json", {
format: "text"
});
expect(contents).to.be.a("string");
expect(contents).to.contain(`{"test":true}`);
});
});
1 change: 1 addition & 0 deletions test/serverContents/format.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"test":true}
7 changes: 7 additions & 0 deletions test/web/getFileContents.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,11 @@ describe("getDirectoryContents", function() {
.that.is.an("object");
});
});

it("can retrieve JSON files as text (#267)", function() {
return this.client.getFileContents("/format.json", { format: "text" }).then(contents => {
expect(contents).to.be.a("string");
expect(contents).to.contain(`{"test":true}`);
});
});
});

0 comments on commit 5872383

Please sign in to comment.