Skip to content

Instantly share code, notes, and snippets.

@PCreations
Last active September 4, 2020 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PCreations/82bb222fb1cc17c18370c97a7e6584dd to your computer and use it in GitHub Desktop.
Save PCreations/82bb222fb1cc17c18370c97a7e6584dd to your computer and use it in GitHub Desktop.
describe("s3xmlUploader", () => {
it("can be nullable", async () => {
// arrange
const xmlUploader = createFakeS3xmlUploader({ bucketName: "test-bucket" });
const xmlString =
'<?xml version="1.0" encoding="UTF-8"?><hello><to>Test</to></hello>';
const domain = "www.my-website.co.uk";
// act
await xmlUploader.upload({ domain, xmlString });
// assert
expect(xmlUploader.getLastPutObject()).toEqual({
Bucket: "test-bucket",
Key: "www.my-website.co.uk/sitemap.xml",
Body: xmlString,
ContentType: "application/xml",
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment