Skip to content

Commit

Permalink
chore(release): pulling release/2.0.1 into master
Browse files Browse the repository at this point in the history
chore(release): pulling release/2.0.1 into master
  • Loading branch information
MoumitaM authored Jan 18, 2023
2 parents c79910a + e69ca15 commit 14d28d0
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 15 deletions.
8 changes: 7 additions & 1 deletion History.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

## [v2.0.1](https://github.com/rudderlabs/rudder-sdk-node/compare/v2.0.0...v2.0.1)

### Fixes

- library info override when provided in context [`#89`](https://github.com/rudderlabs/rudder-sdk-node/pull/89)

## [v2.0.0](https://github.com/rudderlabs/rudder-sdk-node/compare/v1.1.4...v2.0.0)

### Features
Expand All @@ -26,7 +32,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

### BREAKING CHANGES

- Allow dataPlaneUrl to be be passed in options instead as an argument in initialization. [`#81`](https://github.com/rudderlabs/rudder-sdk-node/pull/81)
- Allow dataPlaneUrl to be passed in options instead as an argument in initialization and must no longer include '/v1/batch' part. [`#81`](https://github.com/rudderlabs/rudder-sdk-node/pull/81)

## [v1.1.4](https://github.com/rudderlabs/rudder-sdk-node/compare/v1.1.3...v1.1.4)

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,11 +514,11 @@ class Analytics {
lMessage.type = type;

lMessage.context = {
...lMessage.context,
library: {
name: 'analytics-node',
version,
},
...lMessage.context,
};

lMessage.channel = 'server';
Expand Down
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rudderstack/rudder-sdk-node",
"version": "2.0.0",
"version": "2.0.1",
"description": "Rudder Node SDK",
"license": "",
"repository": "rudderlabs/rudder-sdk-node",
Expand Down
59 changes: 59 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -766,3 +766,62 @@ test('ensure other axios clients are not impacted by axios-retry', async (t) =>

server.close();
});

test('ensure library information not overridden if provided in context object', (t) => {
const client = createClient();
const customContext = {
library: {
name: 'random-sdk',
version: '1234',
},
};

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 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 14d28d0

Please sign in to comment.