Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: change CI target for next #304

Merged
merged 4 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/ci-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ on:
push:
branches:
- master
- next
pull_request:
workflow_dispatch:

jobs:
test:
uses: hapijs/.github/.github/workflows/ci-module.yml@master
with:
min-node-version: 14
uses: hapijs/.github/.github/workflows/ci-module.yml@min-node-18-hapi-21
14 changes: 10 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1366,9 +1366,13 @@ describe('read()', () => {
it('handles requests that close early', async (flags) => {

let readPromise;
let readError;
const handler = (req, res) => {

readPromise = Wreck.read(req);
readPromise = Wreck.read(req).catch((err) => {

readError = err;
});
promise.req.abort();
};

Expand All @@ -1389,8 +1393,9 @@ describe('read()', () => {
const server = await internals.server(handler);
const promise = Wreck.request('post', `http://localhost:${server.address().port}`, { payload, headers });
await expect(promise).to.reject();
const err = await expect(readPromise).to.reject(Error, 'Payload stream closed prematurely');
expect(err.isBoom).to.equal(true);
await readPromise;
expect(readError).to.be.an.error('Payload stream closed prematurely');
expect(readError.isBoom).to.equal(true);
});

it('errors on partial payload transfers', async (flags) => {
Expand Down Expand Up @@ -2111,7 +2116,8 @@ describe('gunzip', () => {
const options = { json: true };

const err = await expect(Wreck.get(`http://localhost:${server.address().port}`, options)).to.reject();
expect(err).to.be.an.error('Unexpected token \u001f in JSON at position 0');
expect(err).to.be.an.error(/Unexpected token/);
expect(Boom.isBoom(err)).to.be.true();
expect(err.data.res.statusCode).to.equal(200);
expect(err.data.payload).to.equal(Zlib.gzipSync(JSON.stringify({ foo: 'bar' })));
flags.onCleanup = () => server.close();
Expand Down