mirror of
https://github.com/directus/directus.git
synced 2026-01-13 22:58:05 -05:00
* Start setting up @directus/pressure * Build pressure middleware * Add basic readme * Install @directus/pressure * Fix this binding * Experiment * Add defaults util * Cleanup * Fix export * Use directus defaults * Start tests * Add random-utils package * Finish testing for monitor * Add prod deployment * Stop building test files in prod * My favorite * Integrate pressure handler * Add decent defaults * Add retry header + custom error support * Clean-up merge conflict & sort imports * Fix build * Remove default value for retry after * Verify sampleInterval value * ran eslint * updated package lock * updated vitest * Create slimy-zebras-jam.md * Added basic docs for config options * updated pnpm lock and changeset * Update & align new packages * Update .changeset/slimy-zebras-jam.md --------- Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch> Co-authored-by: Brainslug <br41nslug@users.noreply.github.com> Co-authored-by: Brainslug <tim@brainslug.nl>
18 lines
474 B
TypeScript
18 lines
474 B
TypeScript
import { expect, test } from 'vitest';
|
|
import { defaults } from './defaults.js';
|
|
|
|
test('Returns defaults with input properties assigned', () => {
|
|
expect(defaults({ input: true }, { default: 'test' })).toEqual({
|
|
input: true,
|
|
default: 'test',
|
|
});
|
|
});
|
|
|
|
test('Overwrites undefined values in input object', () => {
|
|
type Input = { default: undefined | string };
|
|
|
|
expect(defaults({ default: undefined } as Input, { default: 'test' })).toEqual({
|
|
default: 'test',
|
|
});
|
|
});
|