Skip to content

Commit

Permalink
test: use the recommended sink constructor option
Browse files Browse the repository at this point in the history
  • Loading branch information
wkillerud committed Aug 8, 2024
1 parent fa309aa commit 98405f0
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion test/400.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const FIXTURE_PKG = path.resolve(__dirname, '../fixtures/archive.tgz');

tap.test('400 - GET request with non-existing hostname', async (t) => {
const sink = new Sink();
const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down
4 changes: 2 additions & 2 deletions test/404.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Server from '../lib/main.js';

tap.test('404 - POST request to non existing pathname', async (t) => {
const sink = new Sink();
const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down Expand Up @@ -38,7 +38,7 @@ tap.test('404 - POST request to non existing pathname', async (t) => {

tap.test('404 - GET request to non existing pathname', async (t) => {
const sink = new Sink();
const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down
2 changes: 1 addition & 1 deletion test/alias.map.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const FIXTURE_MAP_B = path.resolve(__dirname, '../fixtures/import-map-b.json');

tap.beforeEach(async (t) => {
const sink = new Sink();
const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down
2 changes: 1 addition & 1 deletion test/alias.npm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tap.cleanSnapshot = (s) => {

tap.beforeEach(async (t) => {
const sink = new Sink();
const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down
2 changes: 1 addition & 1 deletion test/alias.pkg.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tap.cleanSnapshot = (s) => {

tap.beforeEach(async (t) => {
const sink = new Sink();
const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down
4 changes: 2 additions & 2 deletions test/auth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Server from '../lib/main.js';

tap.test('auth - authenticate - legal "key" value', async (t) => {
const sink = new Sink();
const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down Expand Up @@ -43,7 +43,7 @@ tap.test('auth - authenticate - legal "key" value', async (t) => {

tap.test('auth - authenticate - illegal "key" value', async (t) => {
const sink = new Sink();
const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down
2 changes: 1 addition & 1 deletion test/http.cache.control.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tap.cleanSnapshot = (s) => {

tap.beforeEach(async (t) => {
const sink = new Sink();
const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down
24 changes: 12 additions & 12 deletions test/http.etag.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Server from '../lib/main.js';

tap.test('ETag - pkg:get - ETag and "If-None-Match" is matching', async (t) => {
const sink = new Sink();
const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down Expand Up @@ -64,7 +64,7 @@ tap.test(
async (t) => {
const sink = new Sink();
const service = new Server({
customSink: sink,
sink,
});

const app = Fastify({
Expand Down Expand Up @@ -123,7 +123,7 @@ tap.test(
async (t) => {
const sink = new Sink();
const service = new Server({
customSink: sink,
sink,
});

const app = Fastify({
Expand Down Expand Up @@ -176,7 +176,7 @@ tap.test(
/*
tap.test('ETag - pkg:get - ETags is configured to not be set', async t => {
const sink = new Sink();
const service = new Server({ customSink: sink, port: 0, config: { etag: false }, logger: false });
const service = new Server({ sink, port: 0, config: { etag: false }, logger: false });
const address = await service.start();
const url = `${address}/pkg/fuzz/8.4.1/main/index.js`;
Expand Down Expand Up @@ -213,7 +213,7 @@ tap.test('ETag - pkg:get - ETags is configured to not be set', async t => {

tap.test('ETag - pkg:log - ETag and "If-None-Match" is matching', async (t) => {
const sink = new Sink();
const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down Expand Up @@ -266,7 +266,7 @@ tap.test(
async (t) => {
const sink = new Sink();
const service = new Server({
customSink: sink,
sink,
});

const app = Fastify({
Expand Down Expand Up @@ -325,7 +325,7 @@ tap.test(
async (t) => {
const sink = new Sink();
const service = new Server({
customSink: sink,
sink,
});

const app = Fastify({
Expand Down Expand Up @@ -378,7 +378,7 @@ tap.test(
/*
tap.test('ETag - pkg:log - ETags is configured to not be set', async t => {
const sink = new Sink();
const service = new Server({ customSink: sink, port: 0, config: { etag: false }, logger: false });
const service = new Server({ sink, port: 0, config: { etag: false }, logger: false });
const address = await service.start();
const url = `${address}/pkg/fuzz/8.4.1`;
Expand Down Expand Up @@ -415,7 +415,7 @@ tap.test('ETag - pkg:log - ETags is configured to not be set', async t => {

tap.test('ETag - map:get - ETag and "If-None-Match" is matching', async (t) => {
const sink = new Sink();
const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down Expand Up @@ -468,7 +468,7 @@ tap.test(
async (t) => {
const sink = new Sink();
const service = new Server({
customSink: sink,
sink,
});

const app = Fastify({
Expand Down Expand Up @@ -527,7 +527,7 @@ tap.test(
async (t) => {
const sink = new Sink();
const service = new Server({
customSink: sink,
sink,
});

const app = Fastify({
Expand Down Expand Up @@ -580,7 +580,7 @@ tap.test(
/*
tap.test('ETag - map:get - ETags is configured to not be set', async t => {
const sink = new Sink();
const service = new Server({ customSink: sink, port: 0, config: { etag: false }, logger: false });
const service = new Server({ sink, port: 0, config: { etag: false }, logger: false });
const address = await service.start();
const url = `${address}/map/buzz/4.2.2`;
Expand Down
2 changes: 1 addition & 1 deletion test/http.override.cache.control.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tap.cleanSnapshot = (s) => {
tap.beforeEach(async (t) => {
const sink = new Sink();
const service = new Server({
customSink: sink,
sink,
aliasCacheControl: 'public, max-age=600',
});

Expand Down
2 changes: 1 addition & 1 deletion test/http.query.params.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tap.cleanSnapshot = (s) => {

tap.beforeEach(async (t) => {
const sink = new Sink();
const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down
2 changes: 1 addition & 1 deletion test/map.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const FIXTURE_MAP = path.resolve(__dirname, '../fixtures/import-map.json');

tap.beforeEach(async (t) => {
const sink = new Sink();
const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down
2 changes: 1 addition & 1 deletion test/npm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tap.cleanSnapshot = (s) => {

tap.beforeEach(async (t) => {
const sink = new Sink();
const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down
8 changes: 4 additions & 4 deletions test/pkg-put-write-integrity.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ tap.test(
return Math.floor(Math.random() * max) + min;
};

const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down Expand Up @@ -96,7 +96,7 @@ tap.test(
return Math.floor(Math.random() * max) + min;
};

const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down Expand Up @@ -146,7 +146,7 @@ tap.test(
return Math.floor(Math.random() * max) + min;
};

const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down Expand Up @@ -196,7 +196,7 @@ tap.test(
return Math.floor(Math.random() * max) + min;
};

const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down
2 changes: 1 addition & 1 deletion test/pkg.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tap.cleanSnapshot = (s) => {

tap.beforeEach(async (t) => {
const sink = new Sink();
const service = new Server({ customSink: sink });
const service = new Server({ sink });

const app = Fastify({
ignoreTrailingSlash: true,
Expand Down

0 comments on commit 98405f0

Please sign in to comment.