Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcL committed Mar 8, 2020
1 parent 19c2285 commit f887fea
Show file tree
Hide file tree
Showing 8 changed files with 1,666 additions and 1,622 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"presets": [
"env"
"@babel/preset-env"
]
}
4 changes: 4 additions & 0 deletions .mocharc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
require: '@babel/register',
recursive: true
};
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@
"request-promise": "^4.2.4"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-register": "^6.26.0",
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.7",
"@babel/preset-env": "^7.8.7",
"@babel/register": "^7.8.6",
"chai": "^4.2.0",
"eslint": "^5.3.0",
"eslint-config-airbnb-base": "^13.2.0",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-plugin-import": "^2.18.1",
"husky": "^3.0.1",
"mocha": "^6.2.0",
"sinon": "^7.3.2"
"mocha": "^7.1.0",
"sinon": "^9.0.0"
},
"husky": {
"hooks": {
Expand Down
16 changes: 7 additions & 9 deletions src/broadcast.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,13 @@ const broadcast = (options) => {

const chatfuelBroadcastUrl = createChatfuelBroadcastUrl(botId, userId);

const query = Object.assign(
{},
{
chatfuel_token: token,
chatfuel_message_tag: messageTag,
},
chatfuelRedirectBlock,
attributes,
);
const query = {

chatfuel_token: token,
chatfuel_message_tag: messageTag,
...chatfuelRedirectBlock,
...attributes,
};

const chatfuelApiUrl = url.format({
pathname: chatfuelBroadcastUrl,
Expand Down
2 changes: 1 addition & 1 deletion src/validateFacebookTags.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ const validFacebookTags = [
'HUMAN_AGENT',
];

const validateFacebookTags = tag => validFacebookTags.includes(tag);
const validateFacebookTags = (tag) => validFacebookTags.includes(tag);

export default validateFacebookTags;
2 changes: 0 additions & 2 deletions test/mocha.opts

This file was deleted.

10 changes: 3 additions & 7 deletions test/unit/broadcast.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ describe('Chatfuel.broadcast()', () => {
});

it("when blockId is passed but isn't a hex value", () => {
const passedOptions = Object.assign({}, defaultOptions, {
blockId: 'NotAHexValue',
});
const passedOptions = { ...defaultOptions, blockId: 'NotAHexValue' };

const wrapperFunction = () => broadcast(passedOptions);

Expand All @@ -110,9 +108,7 @@ describe('Chatfuel.broadcast()', () => {

it('when messageTag is invalid', () => {
const invalidMessageTag = 'invalidMessageTag';
const passedOptions = Object.assign({}, defaultOptions, {
messageTag: invalidMessageTag,
});
const passedOptions = { ...defaultOptions, messageTag: invalidMessageTag };

const wrapperFunction = () => broadcast(passedOptions);

Expand Down Expand Up @@ -191,7 +187,7 @@ describe('Chatfuel.broadcast()', () => {
fakeattribute1: 'fakeAttribute1',
fakeattribute2: 'fakeAttribute2',
};
const options = Object.assign({}, defaultOptions, { attributes: givenAttributes });
const options = { ...defaultOptions, attributes: givenAttributes };
const fakeAttributeQueryParameters = 'fakeattribute1=fakeAttribute1&fakeattribute2=fakeAttribute2';

const chatfuelEndpointUrl = `https://api.chatfuel.com/bots/${defaultBotId}/users/${defaultUserId}/send`;
Expand Down

0 comments on commit f887fea

Please sign in to comment.