Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
avdeev committed Aug 10, 2023
1 parent d1783d6 commit ff60832
Show file tree
Hide file tree
Showing 9 changed files with 2,571 additions and 2,407 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
quote_type = single

[*.md]
trim_trailing_whitespace = false
4,862 changes: 2,490 additions & 2,372 deletions package-lock.json

Large diffs are not rendered by default.

41 changes: 26 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,23 @@
"jest": true,
"es6": true
},
"rules": {
"comma-dangle": "off"
},
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
"extensions": [
".js",
".jsx",
".ts",
".tsx"
]
}
}
}
},
"jest": {
"testURL": "http://localhost/",
"collectCoverageFrom": [
"src/**/*.js",
"!src/main.js",
Expand All @@ -89,25 +96,29 @@
"src"
],
"testRegex": "tests/.*\\.test\\.js$",
"testEnvironment": "jsdom"
"testEnvironment": "jsdom",
"testEnvironmentOptions": {
"url": "http://localhost/"
}
},
"devDependencies": {
"@babel/core": "7.22.8",
"@babel/eslint-parser": "7.22.7",
"@babel/preset-env": "7.22.7",
"@faker-js/faker": "7.6.0",
"@babel/core": "7.22.10",
"@babel/eslint-parser": "7.22.10",
"@babel/preset-env": "7.22.10",
"@faker-js/faker": "8.0.2",
"@rollup/plugin-babel": "6.0.3",
"@size-limit/preset-small-lib": "8.2.6",
"@types/estree": "0.0.52",
"eslint": "8.44.0",
"@types/node": "18.17.4",
"eslint": "8.46.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-import-resolver-webpack": "0.13.2",
"eslint-plugin-import": "2.27.5",
"eslint-import-resolver-webpack": "0.13.4",
"eslint-plugin-import": "2.28.0",
"husky": "8.0.3",
"jest": "27.5.1",
"jest": "29.6.2",
"jest-environment-jsdom": "29.6.2",
"lint-staged": "13.2.3",
"rollup": "2.79.1",
"size-limit": "7.0.8",
"typescript": "4.8.4"
"rollup": "3.28.0",
"size-limit": "8.2.6",
"typescript": "5.1.6"
}
}
2 changes: 1 addition & 1 deletion rollup.config.js → rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import babel from '@rollup/plugin-babel';
import pkg from './package.json';
import pkg from './package.json' assert { type: 'json' };

export default [
{
Expand Down
12 changes: 9 additions & 3 deletions src/sharers/tests/fbFeed.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,24 @@ describe('fbFeed', () => {
});

it('should call with fbAppId', () => {
const fixture = faker.datatype.number();
const fixture = faker.number.int();

fbFeed({ fbAppId: fixture });

expect(window.open.mock.calls[0][0]).toBe(`https://www.facebook.com/dialog/feed?app_id=${fixture}&display=popup`);
expect(window.open.mock.calls[0][0]).toBe(
`https://www.facebook.com/dialog/feed?app_id=${fixture}&display=popup`
);
});

it('should call with url and fbAppId', () => {
const fixture = faker.internet.url();

fbFeed({ url: fixture, fbAppId: 123 });

expect(window.open.mock.calls[0][0]).toBe(`https://www.facebook.com/dialog/feed?app_id=123&display=popup&link=${encodeURIComponent(fixture)}`);
expect(window.open.mock.calls[0][0]).toBe(
`https://www.facebook.com/dialog/feed?app_id=123&display=popup&link=${encodeURIComponent(
fixture
)}`
);
});
});
18 changes: 14 additions & 4 deletions src/sharers/tests/fbShare.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,36 @@ describe('fbShare', () => {
});

it('should call with fbAppId', () => {
const fixture = faker.datatype.number();
const fixture = faker.number.int();

fbShare({ fbAppId: fixture });

expect(window.open.mock.calls[0][0]).toBe(`https://www.facebook.com/dialog/share?app_id=${fixture}&display=popup`);
expect(window.open.mock.calls[0][0]).toBe(
`https://www.facebook.com/dialog/share?app_id=${fixture}&display=popup`,
);
});

it('should call with url and fbAppId', () => {
const fixture = faker.internet.url();

fbShare({ url: fixture, fbAppId: 123 });

expect(window.open.mock.calls[0][0]).toBe(`https://www.facebook.com/dialog/share?app_id=123&display=popup&href=${encodeURIComponent(fixture)}`);
expect(window.open.mock.calls[0][0]).toBe(
`https://www.facebook.com/dialog/share?app_id=123&display=popup&href=${encodeURIComponent(
fixture,
)}`,
);
});

it('should call with hashtag and fbAppId', () => {
const fixture = faker.lorem.word();

fbShare({ hashtag: fixture, fbAppId: 123 });

expect(window.open.mock.calls[0][0]).toBe(`https://www.facebook.com/dialog/share?app_id=123&display=popup&hashtag=${encodeURIComponent(fixture)}`);
expect(window.open.mock.calls[0][0]).toBe(
`https://www.facebook.com/dialog/share?app_id=123&display=popup&hashtag=${encodeURIComponent(
fixture,
)}`,
);
});
});
18 changes: 13 additions & 5 deletions src/sharers/tests/mail.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,38 @@ describe('mail', () => {

mail({ url: fixture });

expect(window.open.mock.calls[0][0]).toBe(`http://connect.mail.ru/share?share_url=${encodeURIComponent(fixture)}`);
expect(window.open.mock.calls[0][0]).toBe(
`http://connect.mail.ru/share?share_url=${encodeURIComponent(fixture)}`,
);
});

it('should call with title', () => {
const fixture = faker.lorem.sentence();

mail({ title: fixture });

expect(window.open.mock.calls[0][0]).toBe(`http://connect.mail.ru/share?title=${encodeURIComponent(fixture)}`);
expect(window.open.mock.calls[0][0]).toBe(
`http://connect.mail.ru/share?title=${encodeURIComponent(fixture)}`,
);
});

it('should call with description', () => {
const fixture = faker.lorem.sentences();

mail({ description: fixture });

expect(window.open.mock.calls[0][0]).toBe(`http://connect.mail.ru/share?description=${encodeURIComponent(fixture)}`);
expect(window.open.mock.calls[0][0]).toBe(
`http://connect.mail.ru/share?description=${encodeURIComponent(fixture)}`,
);
});

it('should call with image', () => {
const fixture = faker.image.imageUrl();
const fixture = faker.image.url();

mail({ image: fixture });

expect(window.open.mock.calls[0][0]).toBe(`http://connect.mail.ru/share?imageurl=${encodeURIComponent(fixture)}`);
expect(window.open.mock.calls[0][0]).toBe(
`http://connect.mail.ru/share?imageurl=${encodeURIComponent(fixture)}`,
);
});
});
10 changes: 7 additions & 3 deletions src/sharers/tests/messenger.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@ describe('messenger', () => {
});

it('should call with fbAppId', () => {
const fixture = faker.datatype.number();
const fixture = faker.number.int();

messenger({ fbAppId: fixture });

expect(window.location.assign.mock.calls[0][0]).toBe(`fb-messenger://share?app_id=${fixture}`);
expect(window.location.assign.mock.calls[0][0]).toBe(
`fb-messenger://share?app_id=${fixture}`,
);
});

it('should call with url and fbAppId', () => {
const fixture = faker.internet.url();

messenger({ url: fixture, fbAppId: 123 });

expect(window.location.assign.mock.calls[0][0]).toBe(`fb-messenger://share?app_id=123&link=${encodeURIComponent(fixture)}`);
expect(window.location.assign.mock.calls[0][0]).toBe(
`fb-messenger://share?app_id=123&link=${encodeURIComponent(fixture)}`,
);
});
});
14 changes: 10 additions & 4 deletions src/sharers/tests/ok.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,28 @@ describe('ok', () => {

ok({ url: fixture });

expect(window.open.mock.calls[0][0]).toBe(`https://connect.ok.ru/offer?url=${encodeURIComponent(fixture)}`);
expect(window.open.mock.calls[0][0]).toBe(
`https://connect.ok.ru/offer?url=${encodeURIComponent(fixture)}`,
);
});

it('should call with title', () => {
const fixture = faker.lorem.sentence();

ok({ title: fixture });

expect(window.open.mock.calls[0][0]).toBe(`https://connect.ok.ru/offer?title=${encodeURIComponent(fixture)}`);
expect(window.open.mock.calls[0][0]).toBe(
`https://connect.ok.ru/offer?title=${encodeURIComponent(fixture)}`,
);
});

it('should call with image', () => {
const fixture = faker.image.imageUrl();
const fixture = faker.image.url();

ok({ image: fixture });

expect(window.open.mock.calls[0][0]).toBe(`https://connect.ok.ru/offer?imageUrl=${encodeURIComponent(fixture)}`);
expect(window.open.mock.calls[0][0]).toBe(
`https://connect.ok.ru/offer?imageUrl=${encodeURIComponent(fixture)}`,
);
});
});

0 comments on commit ff60832

Please sign in to comment.