diff options
author | 2024-01-25 16:17:31 +0000 | |
---|---|---|
committer | 2024-01-25 16:17:31 +0000 | |
commit | fc21a3c306f552a3048b0a0899b5f21c1c9269c1 (patch) | |
tree | ba619951f09147eb2893ec5b5f113014ee3f746e /packages/integrations/node/test/bad-urls.test.js | |
parent | d688954c5adba75b0d676694fbf5fb0da1c0af13 (diff) | |
download | astro-fc21a3c306f552a3048b0a0899b5f21c1c9269c1.tar.gz astro-fc21a3c306f552a3048b0a0899b5f21c1c9269c1.tar.zst astro-fc21a3c306f552a3048b0a0899b5f21c1c9269c1.zip |
chore(@astrojs/node): use Node.js for testing (#9758)
* chore(@astrojs/node): use Node.js for testing
* revert file
* address feedback
* feedback
* Run tests in a single process (#9823)
* Run tests in a single process
* Make test less flaky
* chore: remove module
---------
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Diffstat (limited to 'packages/integrations/node/test/bad-urls.test.js')
-rw-r--r-- | packages/integrations/node/test/bad-urls.test.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/packages/integrations/node/test/bad-urls.test.js b/packages/integrations/node/test/bad-urls.test.js index bfef81278..6d6c0a2e9 100644 --- a/packages/integrations/node/test/bad-urls.test.js +++ b/packages/integrations/node/test/bad-urls.test.js @@ -1,4 +1,5 @@ -import { expect } from 'chai'; +import * as assert from 'node:assert/strict'; +import { describe, it, before, after } from 'node:test'; import nodejs from '../dist/index.js'; import { loadFixture } from './test-utils.js'; @@ -32,15 +33,17 @@ describe('Bad URLs', () => { '%20foobar%', ]; + const statusCodes = [400, 404, 500]; for (const weirdUrl of weirdURLs) { const fetchResult = await fixture.fetch(weirdUrl); - expect([400, 404, 500]).to.include( - fetchResult.status, + assert.equal( + statusCodes.includes(fetchResult.status), + true, `${weirdUrl} returned something else than 400, 404, or 500` ); } const stillWork = await fixture.fetch('/'); const text = await stillWork.text(); - expect(text).to.equal('<!DOCTYPE html>Hello!'); + assert.equal(text, '<!DOCTYPE html>Hello!'); }); }); |