Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
elchininet committed Jul 29, 2023
1 parent c777d18 commit 4cafbd0
Show file tree
Hide file tree
Showing 7 changed files with 1,154 additions and 937 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module.exports = {
quotes: ['error', 'single', { 'avoidEscape': true, 'allowTemplateLiterals': true }],
semi: ['error', 'always'],
'@typescript-eslint/no-empty-interface': ['error', { allowSingleExtends: true }],
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
'no-trailing-spaces': ['error']
},
overrides: [
Expand Down
45 changes: 24 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,34 +59,37 @@
"jsdom": "^18.0.1"
},
"devDependencies": {
"@types/jest": "^29.5.0",
"@types/node": "^18.15.11",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"@types/jest": "^29.5.3",
"@types/node": "^20.4.5",
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.3",
"eslint": "^8.38.0",
"css-loader": "^6.8.1",
"eslint": "^8.46.0",
"google-code-prettify": "^1.0.5",
"html-webpack-plugin": "^5.5.0",
"jest": "^29.0.3",
"jest-environment-jsdom": "^29.5.0",
"mini-css-extract-plugin": "^2.7.5",
"node-sass": "^8.0.0",
"rimraf": "^5.0.0",
"rollup": "^3.20.2",
"html-webpack-plugin": "^5.5.3",
"jest": "^29.6.2",
"jest-environment-jsdom": "^29.6.2",
"mini-css-extract-plugin": "^2.7.6",
"node-sass": "^9.0.0",
"rimraf": "^5.0.1",
"rollup": "^3.27.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-ts": "^3.2.0",
"sass-loader": "^13.2.2",
"style-loader": "^3.3.2",
"ts-jest": "^29.1.0",
"ts-loader": "^9.4.2",
"typescript": "^5.0.4",
"webpack": "^5.78.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.13.2"
"sass-loader": "^13.3.2",
"style-loader": "^3.3.3",
"ts-jest": "^29.1.1",
"ts-loader": "^9.4.4",
"typescript": "^5.1.6",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
},
"engines": {
"node": ">=12.22.0"
},
"dependencies": {
"jsdom": "^22.1.0"
}
}
30 changes: 15 additions & 15 deletions tests/container.change.child.index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ describe('Test changing container‘s child index', (): void => {

it('Check initial children order', (): void => {

expect(canvas.children).toMatchObject([group, circle, path]);
expect(group.children).toMatchObject([top, right, left]);
expect(canvas.children).toStrictEqual([group, circle, path]);
expect(group.children).toStrictEqual([top, right, left]);

expect(childIndex(groupElement)).toBe(1);
expect(childIndex(circleElement)).toBe(2);
Expand All @@ -108,39 +108,39 @@ describe('Test changing container‘s child index', (): void => {

canvas.setChildIndex(group, 2);

expect(canvas.children).toMatchObject([circle, path, group]);
expect(canvas.children).toStrictEqual([circle, path, group]);

expect(childIndex(circleElement)).toBe(1);
expect(childIndex(pathElement)).toBe(2);
expect(childIndex(groupElement)).toBe(3);

canvas.setChildIndex(path, 0);

expect(canvas.children).toMatchObject([path, circle, group]);
expect(canvas.children).toStrictEqual([path, circle, group]);

expect(childIndex(pathElement)).toBe(1);
expect(childIndex(circleElement)).toBe(2);
expect(childIndex(groupElement)).toBe(3);

group.setChildIndex(top, 1);

expect(group.children).toMatchObject([right, top, left]);
expect(group.children).toStrictEqual([right, top, left]);

expect(childIndex(rightElement)).toBe(0);
expect(childIndex(topElement)).toBe(1);
expect(childIndex(leftElement)).toBe(2);

group.setChildIndex(top, 10);

expect(group.children).toMatchObject([right, left, top]);
expect(group.children).toStrictEqual([right, left, top]);

expect(childIndex(rightElement)).toBe(0);
expect(childIndex(leftElement)).toBe(1);
expect(childIndex(topElement)).toBe(2);

group.setChildIndex(left, -10);

expect(group.children).toMatchObject([left, right, top]);
expect(group.children).toStrictEqual([left, right, top]);

expect(childIndex(leftElement)).toBe(0);
expect(childIndex(rightElement)).toBe(1);
Expand All @@ -152,15 +152,15 @@ describe('Test changing container‘s child index', (): void => {

canvas.bringChildToFront(group);

expect(canvas.children).toMatchObject([circle, path, group]);
expect(canvas.children).toStrictEqual([circle, path, group]);

expect(childIndex(circleElement)).toBe(1);
expect(childIndex(pathElement)).toBe(2);
expect(childIndex(groupElement)).toBe(3);

group.bringChildToFront(right);

expect(group.children).toMatchObject([top, left, right]);
expect(group.children).toStrictEqual([top, left, right]);

expect(childIndex(topElement)).toBe(0);
expect(childIndex(leftElement)).toBe(1);
Expand All @@ -172,15 +172,15 @@ describe('Test changing container‘s child index', (): void => {

canvas.sendChildToBack(path);

expect(canvas.children).toMatchObject([path, group, circle]);
expect(canvas.children).toStrictEqual([path, group, circle]);

expect(childIndex(pathElement)).toBe(1);
expect(childIndex(groupElement)).toBe(2);
expect(childIndex(circleElement)).toBe(3);

group.sendChildToBack(right);

expect(group.children).toMatchObject([right, top, left]);
expect(group.children).toStrictEqual([right, top, left]);

expect(childIndex(rightElement)).toBe(0);
expect(childIndex(topElement)).toBe(1);
Expand All @@ -192,15 +192,15 @@ describe('Test changing container‘s child index', (): void => {

canvas.bringChildForward(circle);

expect(canvas.children).toMatchObject([group, path, circle]);
expect(canvas.children).toStrictEqual([group, path, circle]);

expect(childIndex(groupElement)).toBe(1);
expect(childIndex(pathElement)).toBe(2);
expect(childIndex(circleElement)).toBe(3);

group.bringChildForward(top);

expect(group.children).toMatchObject([right, top, left]);
expect(group.children).toStrictEqual([right, top, left]);

expect(childIndex(rightElement)).toBe(0);
expect(childIndex(topElement)).toBe(1);
Expand All @@ -212,15 +212,15 @@ describe('Test changing container‘s child index', (): void => {

canvas.sendChildBackward(path);

expect(canvas.children).toMatchObject([group, path, circle]);
expect(canvas.children).toStrictEqual([group, path, circle]);

expect(childIndex(groupElement)).toBe(1);
expect(childIndex(pathElement)).toBe(2);
expect(childIndex(circleElement)).toBe(3);

group.sendChildBackward(right);

expect(group.children).toMatchObject([right, top, left]);
expect(group.children).toStrictEqual([right, top, left]);

expect(childIndex(rightElement)).toBe(0);
expect(childIndex(topElement)).toBe(1);
Expand Down
6 changes: 3 additions & 3 deletions tests/drag.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ describe('Test dragging', (): void => {

group.bounds = { right: bounds.right, left: bounds.left };

expect(group.bounds).toMatchObject({
expect(group.bounds).toStrictEqual({
right: bounds.right,
left: bounds.left
});
Expand All @@ -256,7 +256,7 @@ describe('Test dragging', (): void => {

group.bounds = { left: bounds.left, top: bounds.top };

expect(group.bounds).toMatchObject({
expect(group.bounds).toStrictEqual({
left: bounds.left,
top: bounds.top
});
Expand All @@ -277,7 +277,7 @@ describe('Test dragging', (): void => {

group.bounds = { right: bounds.right, top: bounds.top };

expect(group.bounds).toMatchObject({
expect(group.bounds).toStrictEqual({
right: bounds.right,
top: bounds.top
});
Expand Down
24 changes: 12 additions & 12 deletions tests/properties.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ describe('Test properties', (): void => {
expect(path.fillColor).toBe(rectangle.fillColor);
expect(path.fillOpacity).toBe(rectangle.fillOpacity);
expect(path.strokeColor).toBe(rectangle.strokeColor);
expect(path.strokeDashArray).toMatchObject(rectangle.strokeDashArray);
expect(path.strokeDashArray).toStrictEqual(rectangle.strokeDashArray);
expect(path.strokeLinecap).toBe(rectangle.strokeLinecap);
expect(path.strokeLinejoin).toBe(rectangle.strokeLinejoin);
expect(path.strokeOpacity).toBe(rectangle.strokeOpacity);
Expand All @@ -178,7 +178,7 @@ describe('Test properties', (): void => {
expect(path.fillColor).toBe(circle.fillColor);
expect(path.fillOpacity).toBe(circle.fillOpacity);
expect(path.strokeColor).toBe(circle.strokeColor);
expect(path.strokeDashArray).toMatchObject(circle.strokeDashArray);
expect(path.strokeDashArray).toStrictEqual(circle.strokeDashArray);
expect(path.strokeLinecap).toBe(circle.strokeLinecap);
expect(path.strokeLinejoin).toBe(circle.strokeLinejoin);
expect(path.strokeOpacity).toBe(circle.strokeOpacity);
Expand Down Expand Up @@ -245,7 +245,7 @@ describe('Test properties', (): void => {
expect(path.fillColor).toBe('#FFF');
expect(path.fillOpacity).toBe(0.5);
expect(path.strokeColor).toBe('#000');
expect(path.strokeDashArray).toMatchObject([1, 2, 3]);
expect(path.strokeDashArray).toStrictEqual([1, 2, 3]);
expect(path.strokeLinecap).toBe('round');
expect(path.strokeLinejoin).toBe('miter');
expect(path.strokeOpacity).toBe(0.25);
Expand Down Expand Up @@ -275,7 +275,7 @@ describe('Test properties', (): void => {
expect(path.fillColor).toBe('#000');
expect(path.fillOpacity).toBe(1);
expect(path.strokeColor).toBe('#FFF');
expect(path.strokeDashArray).toMatchObject([3, 2, 1]);
expect(path.strokeDashArray).toStrictEqual([3, 2, 1]);
expect(path.strokeLinecap).toBe('butt');
expect(path.strokeLinejoin).toBe('bevel');
expect(path.strokeOpacity).toBe(0.75);
Expand All @@ -299,7 +299,7 @@ describe('Test properties', (): void => {
expect(rectangle.fillColor).toBe('#FFF');
expect(rectangle.fillOpacity).toBe(0.5);
expect(rectangle.strokeColor).toBe('#000');
expect(rectangle.strokeDashArray).toMatchObject([1, 2, 3]);
expect(rectangle.strokeDashArray).toStrictEqual([1, 2, 3]);
expect(rectangle.strokeLinecap).toBe('round');
expect(rectangle.strokeLinejoin).toBe('miter');
expect(rectangle.strokeOpacity).toBe(0.25);
Expand All @@ -326,7 +326,7 @@ describe('Test properties', (): void => {
expect(rectangle.fillColor).toBe('#000');
expect(rectangle.fillOpacity).toBe(1);
expect(rectangle.strokeColor).toBe('#FFF');
expect(rectangle.strokeDashArray).toMatchObject([3, 2, 1]);
expect(rectangle.strokeDashArray).toStrictEqual([3, 2, 1]);
expect(rectangle.strokeLinecap).toBe('butt');
expect(rectangle.strokeLinejoin).toBe('bevel');
expect(rectangle.strokeOpacity).toBe(0.75);
Expand All @@ -348,7 +348,7 @@ describe('Test properties', (): void => {
expect(text.fillColor).toBe('#FFF');
expect(text.fillOpacity).toBe(0.5);
expect(text.strokeColor).toBe('#000');
expect(text.strokeDashArray).toMatchObject([1, 2, 3]);
expect(text.strokeDashArray).toStrictEqual([1, 2, 3]);
expect(text.strokeLinecap).toBe('round');
expect(text.strokeLinejoin).toBe('miter');
expect(text.strokeOpacity).toBe(0.25);
Expand All @@ -363,7 +363,7 @@ describe('Test properties', (): void => {
expect(text.left).toBe(0.5);
expect(text.top).toBe(1.5);
expect(text.rotation).toBe(45);
expect(text.origin).toMatchObject(['left', 'bottom']);
expect(text.origin).toStrictEqual(['left', 'bottom']);
expect(text.selectable).toBe(false);

expect(textGroupElement.getAttribute('fill')).toBe('#FFF');
Expand Down Expand Up @@ -410,7 +410,7 @@ describe('Test properties', (): void => {
expect(text.fillColor).toBe('#000');
expect(text.fillOpacity).toBe(1);
expect(text.strokeColor).toBe('#FFF');
expect(text.strokeDashArray).toMatchObject([3, 2, 1]);
expect(text.strokeDashArray).toStrictEqual([3, 2, 1]);
expect(text.strokeLinecap).toBe('butt');
expect(text.strokeLinejoin).toBe('bevel');
expect(text.strokeOpacity).toBe(0.75);
Expand All @@ -425,7 +425,7 @@ describe('Test properties', (): void => {
expect(text.left).toBe(1);
expect(text.top).toBe(0.5);
expect(text.rotation).toBe(90);
expect(text.origin).toMatchObject(['right', 'top']);
expect(text.origin).toStrictEqual(['right', 'top']);
expect(text.selectable).toBe(true);

expect(textGroupElement.getAttribute('fill')).toBe('#000');
Expand Down Expand Up @@ -461,11 +461,11 @@ describe('Test properties', (): void => {
expect(groupElement.contains(rectangleElement)).toBeTruthy();
expect(groupElement.contains(circleElement)).toBeTruthy();

expect(group.children).toMatchObject([rectangle, circle]);
expect(group.children).toStrictEqual([rectangle, circle]);

group.removeChild(circle);

expect(group.children).toMatchObject([rectangle]);
expect(group.children).toStrictEqual([rectangle]);

expect(groupElement.contains(circleElement)).toBeFalsy();
expect(svgElement.contains(circleElement)).toBeFalsy();
Expand Down
10 changes: 5 additions & 5 deletions tests/textures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ describe('Test textures', (): void => {

pathPattern = path.getPattern();

expect(path.texture).toMatchObject(cloneTexture);
expect(path.texture).toStrictEqual(cloneTexture);
expect(pathPattern.getAttribute('patternTransform')).toBe('translate(146.077 100) matrix(0.707107,-0.408248,0.707107,0.408248,0,0) scale(1.224745)');

cloneTexture = {
Expand All @@ -562,7 +562,7 @@ describe('Test textures', (): void => {
path.texture = cloneTexture;
const image = pathPattern.firstChild as SVGImageElement;

expect(path.texture).toMatchObject(cloneTexture);
expect(path.texture).toStrictEqual(cloneTexture);
expect(image.style.imageRendering).toBe('');
expect(pathPattern.getAttribute('patternTransform')).toBe('translate(250 160) matrix(0.707107,-0.408248,0.707107,0.408248,0,0) scale(0.612372)');

Expand Down Expand Up @@ -616,7 +616,7 @@ describe('Test textures', (): void => {
pathPattern = path.getPattern();
image = pathPattern.firstChild as SVGImageElement;

expect(path.texture).toMatchObject({
expect(path.texture).toStrictEqual({
...cloneTexture,
shift: { left: 1 }
});
Expand All @@ -631,7 +631,7 @@ describe('Test textures', (): void => {
url: newUrl
});

expect(path.texture).toMatchObject({
expect(path.texture).toStrictEqual({
...cloneTexture,
url: newUrl,
shift: { left: 1 }
Expand All @@ -643,7 +643,7 @@ describe('Test textures', (): void => {
pixelated: false
});

expect(path.texture).toMatchObject({
expect(path.texture).toStrictEqual({
...cloneTexture,
shift: { left: 1 },
pixelated: false
Expand Down

0 comments on commit 4cafbd0

Please sign in to comment.