diff options
author | 2024-02-16 18:57:14 +0900 | |
---|---|---|
committer | 2024-02-16 10:57:14 +0100 | |
commit | 5bbbeaff265de7e663124fa19170764b3d0372ba (patch) | |
tree | 63123f461888957d115ca7cabd2ef9aeacabd417 /packages/integrations/netlify/test/functions/cookies.test.js | |
parent | 7c676f3a4d63d5273bf91002e1af1f35027313af (diff) | |
download | astro-5bbbeaff265de7e663124fa19170764b3d0372ba.tar.gz astro-5bbbeaff265de7e663124fa19170764b3d0372ba.tar.zst astro-5bbbeaff265de7e663124fa19170764b3d0372ba.zip |
chore(netlify): use Node.js for testing (#158)
Diffstat (limited to 'packages/integrations/netlify/test/functions/cookies.test.js')
-rw-r--r-- | packages/integrations/netlify/test/functions/cookies.test.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/packages/integrations/netlify/test/functions/cookies.test.js b/packages/integrations/netlify/test/functions/cookies.test.js index cb81d097a..9d25a873e 100644 --- a/packages/integrations/netlify/test/functions/cookies.test.js +++ b/packages/integrations/netlify/test/functions/cookies.test.js @@ -1,5 +1,6 @@ import { loadFixture } from '@astrojs/test-utils'; -import { expect } from 'chai'; +import { describe, it, before } from 'node:test'; +import * as assert from 'node:assert/strict'; describe('Cookies', () => { let fixture; @@ -19,9 +20,9 @@ describe('Cookies', () => { new Request('http://example.com/login', { method: 'POST', body: '{}' }), {} ); - expect(resp.status).to.equal(301); - expect(resp.headers.get('location')).to.equal('/'); - expect(resp.headers.getSetCookie()).to.eql(['foo=foo; HttpOnly', 'bar=bar; HttpOnly']); + assert.equal(resp.status,301); + assert.equal(resp.headers.get('location'),'/'); + assert.deepEqual(resp.headers.getSetCookie(),['foo=foo; HttpOnly', 'bar=bar; HttpOnly']); }); it('renders dynamic 404 page', async () => { @@ -38,9 +39,9 @@ describe('Cookies', () => { }), {} ); - expect(resp.status).to.equal(404); + assert.equal(resp.status,404); const text = await resp.text(); - expect(text).to.contain('This is my custom 404 page'); - expect(text).to.contain('x-test: bar'); + assert.equal(text.includes('This is my custom 404 page'),true); + assert.equal(text.includes('x-test: bar'),true); }); }); |