Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b659d827f |
@@ -51,17 +51,13 @@ const hooks: Hooks[] = [{ onShutdown: flush }];
|
|||||||
// The two neighbouring extension points, already exported. Here so a future barrel edit that drops
|
// The two neighbouring extension points, already exported. Here so a future barrel edit that drops
|
||||||
// one is caught by the same test rather than by a user.
|
// one is caught by the same test rather than by a user.
|
||||||
const renderError: ErrorRenderer = () => ({ status: 500, headers: {}, body: 'boom' });
|
const renderError: ErrorRenderer = () => ({ status: 500, headers: {}, body: 'boom' });
|
||||||
const encoder: StreamEncoder = {
|
const encoder: StreamEncoder = { headers: {}, encode: (item) => String(item) };
|
||||||
headers: {},
|
|
||||||
encode: (item) => String(item),
|
|
||||||
encodeError: (err) => String(err),
|
|
||||||
};
|
|
||||||
|
|
||||||
test('every extension point is typeable from the package barrel', () => {
|
test('every extension point is typeable from the package barrel', () => {
|
||||||
expect(prometheusText('x').body).toBe('x');
|
expect(prometheusText('x').body).toBe('x');
|
||||||
expect(typeof metricsPlugin).toBe('function');
|
expect(typeof metricsPlugin).toBe('function');
|
||||||
expect(hooks).toHaveLength(1);
|
expect(hooks).toHaveLength(1);
|
||||||
expect(renderError(new Error('boom'), {} as never)?.status).toBe(500);
|
expect(renderError(new Error('boom'), {} as never).status).toBe(500);
|
||||||
expect(encoder.encode(1)).toBe('1');
|
expect(encoder.encode(1)).toBe('1');
|
||||||
// The workaround the missing export forced, kept as a reminder of what it replaced.
|
// The workaround the missing export forced, kept as a reminder of what it replaced.
|
||||||
expect(typeof JsonTransformer).toBe('function');
|
expect(typeof JsonTransformer).toBe('function');
|
||||||
|
|||||||
Reference in new issue
Block a user