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/errors.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/errors.test.js')
-rw-r--r-- | packages/integrations/node/test/errors.test.js | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/packages/integrations/node/test/errors.test.js b/packages/integrations/node/test/errors.test.js index 6bb93023a..983187475 100644 --- a/packages/integrations/node/test/errors.test.js +++ b/packages/integrations/node/test/errors.test.js @@ -1,6 +1,7 @@ +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'; -import { expect } from 'chai'; import * as cheerio from 'cheerio'; describe('Errors', () => { @@ -13,21 +14,19 @@ describe('Errors', () => { }); await fixture.build(); }); - describe('Within the stream', async () => { - let devPreview; + let devPreview; - before(async () => { - devPreview = await fixture.preview(); - }); - after(async () => { - await devPreview.stop(); - }); - it('when mode is standalone', async () => { - const res = await fixture.fetch('/in-stream'); - const html = await res.text(); - const $ = cheerio.load(html); + before(async () => { + devPreview = await fixture.preview(); + }); + after(async () => { + await devPreview.stop(); + }); + it('when mode is standalone', async () => { + const res = await fixture.fetch('/in-stream'); + const html = await res.text(); + const $ = cheerio.load(html); - expect($('p').text().trim()).to.equal('Internal server error'); - }); + assert.equal($('p').text().trim(), 'Internal server error'); }); }); |