Skip to content

Commit

Permalink
test: test cases added (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoumitaM authored Jan 17, 2023
1 parent 3221644 commit 852468c
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -787,5 +787,41 @@ test('ensure library information not overridden if provided in context object',

const actualContext = client.queue[0].message.context;

t.deepEqual(actualContext, context);
t.deepEqual(actualContext.library, context.library);
});

test('ensure library information not overridden if provided null in context object', (t) => {
const client = createClient();
const customContext = null;

client.enqueue(
'type',
{
event: 'test',
context: customContext,
},
noop,
);

const actualContext = client.queue[0].message.context;

t.deepEqual(actualContext.library, context.library);
});

test('ensure library information not overridden if provided undefined in context object', (t) => {
const client = createClient();
const customContext = undefined;

client.enqueue(
'type',
{
event: 'test',
context: customContext,
},
noop,
);

const actualContext = client.queue[0].message.context;

t.deepEqual(actualContext.library, context.library);
});

0 comments on commit 852468c

Please sign in to comment.