summaryrefslogtreecommitdiff
path: root/packages/integrations/netlify/test/functions/cookies.test.js
diff options
context:
space:
mode:
authorGravatar alexanderniebuhr <alexanderniebuhr@users.noreply.github.com> 2023-10-16 14:26:36 +0000
committerGravatar astrobot-houston <fred+astrobot@astro.build> 2023-10-16 14:26:36 +0000
commit31863b80230cb61390b5cc218c603090b299f204 (patch)
treea05d6a6137101017ed60e144093921883d67a1fc /packages/integrations/netlify/test/functions/cookies.test.js
parent3d1329414e507345b19e1dee81fe1bbff4eb3ae0 (diff)
downloadastro-31863b80230cb61390b5cc218c603090b299f204.tar.gz
astro-31863b80230cb61390b5cc218c603090b299f204.tar.zst
astro-31863b80230cb61390b5cc218c603090b299f204.zip
[ci] format
Diffstat (limited to 'packages/integrations/netlify/test/functions/cookies.test.js')
-rw-r--r--packages/integrations/netlify/test/functions/cookies.test.js54
1 files changed, 27 insertions, 27 deletions
diff --git a/packages/integrations/netlify/test/functions/cookies.test.js b/packages/integrations/netlify/test/functions/cookies.test.js
index 05727207e..328294d10 100644
--- a/packages/integrations/netlify/test/functions/cookies.test.js
+++ b/packages/integrations/netlify/test/functions/cookies.test.js
@@ -1,31 +1,31 @@
-import { expect } from "chai";
-import { cli } from "./test-utils.js";
-import { fileURLToPath } from "url";
+import { expect } from 'chai';
+import { cli } from './test-utils.js';
+import { fileURLToPath } from 'url';
-const root = new URL("./fixtures/cookies/", import.meta.url).toString();
+const root = new URL('./fixtures/cookies/', import.meta.url).toString();
-describe("Cookies", () => {
- before(async () => {
- await cli("build", "--root", fileURLToPath(root));
- });
+describe('Cookies', () => {
+ before(async () => {
+ await cli('build', '--root', fileURLToPath(root));
+ });
- it("Can set multiple", async () => {
- const entryURL = new URL(
- "./fixtures/cookies/.netlify/functions-internal/entry.mjs",
- import.meta.url,
- );
- const { handler } = await import(entryURL);
- const resp = await handler({
- httpMethod: "POST",
- headers: {},
- rawUrl: "http://example.com/login",
- body: "{}",
- isBase64Encoded: false,
- });
- expect(resp.statusCode).to.equal(301);
- expect(resp.headers.location).to.equal("/");
- expect(resp.multiValueHeaders).to.be.deep.equal({
- "set-cookie": ["foo=foo; HttpOnly", "bar=bar; HttpOnly"],
- });
- });
+ it('Can set multiple', async () => {
+ const entryURL = new URL(
+ './fixtures/cookies/.netlify/functions-internal/entry.mjs',
+ import.meta.url
+ );
+ const { handler } = await import(entryURL);
+ const resp = await handler({
+ httpMethod: 'POST',
+ headers: {},
+ rawUrl: 'http://example.com/login',
+ body: '{}',
+ isBase64Encoded: false,
+ });
+ expect(resp.statusCode).to.equal(301);
+ expect(resp.headers.location).to.equal('/');
+ expect(resp.multiValueHeaders).to.be.deep.equal({
+ 'set-cookie': ['foo=foo; HttpOnly', 'bar=bar; HttpOnly'],
+ });
+ });
});