Skip to content

Commit ea2692d

Browse files
authored
Merge pull request #107 from scratchfoundation/renovate/tap-21.x
chore(deps): update dependency tap to v21
2 parents f787f28 + e4faf51 commit ea2692d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+23051
-21238
lines changed

package-lock.json

Lines changed: 22007 additions & 20195 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"prepare": "husky install",
1717
"build": "cross-env NODE_ENV=production npm run --workspaces build",
1818
"clean": "npm run --workspaces clean",
19+
"test": "npm test --workspaces",
1920
"version": "cross-env-shell ./scripts/npm-version.sh"
2021
},
2122
"config": {

packages/scratch-render/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ npm-*
77

88
# Testing
99
/.nyc_output
10+
/.tap
1011
/coverage
1112

1213
# IDEA
@@ -17,4 +18,4 @@ npm-*
1718
/playground
1819

1920
# Act
20-
.secrets
21+
.secrets

packages/scratch-render/package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@
3333
"watch": "webpack --progress --watch --watch-poll"
3434
},
3535
"tap": {
36-
"branches": 10,
37-
"functions": 20,
38-
"lines": 30,
39-
"statements": 30
36+
"allow-incomplete-coverage": true
4037
},
4138
"browserslist": [
4239
"Chrome >= 63",
@@ -80,7 +77,7 @@
8077
"scratch-storage": "4.0.223",
8178
"scratch-webpack-configuration": "3.0.0",
8279
"semantic-release": "19.0.5",
83-
"tap": "16.3.10",
80+
"tap": "21.1.0",
8481
"terser-webpack-plugin": "5.3.14",
8582
"webpack": "5.101.3",
8683
"webpack-cli": "5.1.4",

packages/scratch-render/test/integration/pick-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const runFile = async (file, action, page, script) => {
5252

5353
t.plan(expect.length);
5454
for (let x = 0; x < expect.length; x++) {
55-
t.deepEqual(results[x], expect[x], expect[x][0]);
55+
t.same(results[x], expect[x], expect[x][0]);
5656
}
5757
t.end();
5858
});
Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,46 @@
1-
const {test, Test} = require('tap');
1+
const {test} = require('tap');
22

33
const {rgbToHsv, hsvToRgb} = require('../../src/util/color-conversions');
44

5-
Test.prototype.addAssert('colorsAlmostEqual', 2, function (found, wanted, message, extra) {
6-
/* eslint-disable no-invalid-this */
5+
const colorsAlmostEqual = (t, found, wanted, message, extra) => {
76
message += `: found ${JSON.stringify(Array.from(found))}, wanted ${JSON.stringify(Array.from(wanted))}`;
87

98
// should always return another assert call, or
109
// this.pass(message) or this.fail(message, extra)
1110
if (found.length !== wanted.length) {
12-
return this.fail(message, extra);
11+
return t.fail(message, extra);
1312
}
1413

1514
for (let i = 0; i < found.length; i++) {
1615
// smallest meaningful difference--detects changes in hue value after rounding
1716
if (Math.abs(found[i] - wanted[i]) >= 0.5 / 360) {
18-
return this.fail(message, extra);
17+
return t.fail(message, extra);
1918
}
2019
}
2120

22-
return this.pass(message);
23-
/* eslint-enable no-invalid-this */
24-
});
21+
return t.pass(message);
22+
};
2523

2624
test('RGB to HSV', t => {
2725
const dst = [0, 0, 0];
28-
t.colorsAlmostEqual(rgbToHsv([255, 255, 255], dst), [0, 0, 1], 'white');
29-
t.colorsAlmostEqual(rgbToHsv([0, 0, 0], dst), [0, 0, 0], 'black');
30-
t.colorsAlmostEqual(rgbToHsv([127, 127, 127], dst), [0, 0, 0.498], 'grey');
31-
t.colorsAlmostEqual(rgbToHsv([255, 255, 0], dst), [0.167, 1, 1], 'yellow');
32-
t.colorsAlmostEqual(rgbToHsv([1, 0, 0], dst), [0, 1, 0.00392], 'dark red');
26+
colorsAlmostEqual(t, rgbToHsv([255, 255, 255], dst), [0, 0, 1], 'white');
27+
colorsAlmostEqual(t, rgbToHsv([0, 0, 0], dst), [0, 0, 0], 'black');
28+
colorsAlmostEqual(t, rgbToHsv([127, 127, 127], dst), [0, 0, 0.498], 'grey');
29+
colorsAlmostEqual(t, rgbToHsv([255, 255, 0], dst), [0.167, 1, 1], 'yellow');
30+
colorsAlmostEqual(t, rgbToHsv([1, 0, 0], dst), [0, 1, 0.00392], 'dark red');
3331

3432
t.end();
3533
});
3634

3735
test('HSV to RGB', t => {
3836
const dst = new Uint8ClampedArray(3);
39-
t.colorsAlmostEqual(hsvToRgb([0, 1, 1], dst), [255, 0, 0], 'red');
40-
t.colorsAlmostEqual(hsvToRgb([1, 1, 1], dst), [255, 0, 0], 'red (hue of 1)');
41-
t.colorsAlmostEqual(hsvToRgb([0.5, 1, 1], dst), [0, 255, 255], 'cyan');
42-
t.colorsAlmostEqual(hsvToRgb([1.5, 1, 1], dst), [0, 255, 255], 'cyan (hue of 1.5)');
43-
t.colorsAlmostEqual(hsvToRgb([0, 0, 0], dst), [0, 0, 0], 'black');
44-
t.colorsAlmostEqual(hsvToRgb([0.5, 1, 0], dst), [0, 0, 0], 'black (with hue and saturation)');
45-
t.colorsAlmostEqual(hsvToRgb([0, 1, 0.00392], dst), [1, 0, 0], 'dark red');
37+
colorsAlmostEqual(t, hsvToRgb([0, 1, 1], dst), [255, 0, 0], 'red');
38+
colorsAlmostEqual(t, hsvToRgb([1, 1, 1], dst), [255, 0, 0], 'red (hue of 1)');
39+
colorsAlmostEqual(t, hsvToRgb([0.5, 1, 1], dst), [0, 255, 255], 'cyan');
40+
colorsAlmostEqual(t, hsvToRgb([1.5, 1, 1], dst), [0, 255, 255], 'cyan (hue of 1.5)');
41+
colorsAlmostEqual(t, hsvToRgb([0, 0, 0], dst), [0, 0, 0], 'black');
42+
colorsAlmostEqual(t, hsvToRgb([0.5, 1, 0], dst), [0, 0, 0], 'black (with hue and saturation)');
43+
colorsAlmostEqual(t, hsvToRgb([0, 1, 0.00392], dst), [1, 0, 0], 'dark red');
4644

4745
t.end();
4846
});

packages/scratch-svg-renderer/.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66
npm-*
77

88
# Build
9-
dist/*
9+
/dist
1010
/playground
1111

12+
# Test
13+
/.tap
14+
1215
# Editors
1316
/#*
1417
*~
1518

1619
# Act
17-
.secrets
20+
.secrets

packages/scratch-svg-renderer/package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@
3434
"scratch-render-fonts": "^1.0.0"
3535
},
3636
"tap": {
37-
"branches": 70,
38-
"functions": 50,
39-
"lines": 70,
40-
"statements": 70
37+
"allow-incomplete-coverage": true
4138
},
4239
"dependencies": {
4340
"base64-js": "1.5.1",
@@ -65,7 +62,7 @@
6562
"scratch-semantic-release-config": "3.0.0",
6663
"scratch-webpack-configuration": "3.0.0",
6764
"semantic-release": "19.0.5",
68-
"tap": "16.3.10",
65+
"tap": "21.1.0",
6966
"webpack": "5.101.3",
7067
"webpack-cli": "5.1.4",
7168
"webpack-dev-server": "5.2.2",

packages/scratch-svg-renderer/test/bitmapAdapter_getResized.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,97 +6,97 @@ const BitmapAdapter = require('../src/bitmap-adapter');
66
test('zero', t => {
77
const bitmapAdapter = new BitmapAdapter();
88
const size = bitmapAdapter.getResizedWidthHeight(0, 0);
9-
t.equals(0, size.width);
10-
t.equals(0, size.height);
9+
t.equal(0, size.width);
10+
t.equal(0, size.height);
1111
t.end();
1212
});
1313

1414
// Double (as if it is bitmap resolution 1)
1515
test('smallImg', t => {
1616
const bitmapAdapter = new BitmapAdapter();
1717
const size = bitmapAdapter.getResizedWidthHeight(50, 50);
18-
t.equals(100, size.width);
19-
t.equals(100, size.height);
18+
t.equal(100, size.width);
19+
t.equal(100, size.height);
2020
t.end();
2121
});
2222

2323
// Double (as if it is bitmap resolution 1)
2424
test('stageSizeImage', t => {
2525
const bitmapAdapter = new BitmapAdapter();
2626
const size = bitmapAdapter.getResizedWidthHeight(480, 360);
27-
t.equals(960, size.width);
28-
t.equals(720, size.height);
27+
t.equal(960, size.width);
28+
t.equal(720, size.height);
2929
t.end();
3030
});
3131

3232
// Don't resize
3333
test('mediumHeightImage', t => {
3434
const bitmapAdapter = new BitmapAdapter();
3535
const size = bitmapAdapter.getResizedWidthHeight(50, 700);
36-
t.equals(50, size.width);
37-
t.equals(700, size.height);
36+
t.equal(50, size.width);
37+
t.equal(700, size.height);
3838
t.end();
3939
});
4040

4141
// Don't resize
4242
test('mediumWidthImage', t => {
4343
const bitmapAdapter = new BitmapAdapter();
4444
const size = bitmapAdapter.getResizedWidthHeight(700, 50);
45-
t.equals(700, size.width);
46-
t.equals(50, size.height);
45+
t.equal(700, size.width);
46+
t.equal(50, size.height);
4747
t.end();
4848
});
4949

5050
// Don't resize
5151
test('mediumImage', t => {
5252
const bitmapAdapter = new BitmapAdapter();
5353
const size = bitmapAdapter.getResizedWidthHeight(700, 700);
54-
t.equals(700, size.width);
55-
t.equals(700, size.height);
54+
t.equal(700, size.width);
55+
t.equal(700, size.height);
5656
t.end();
5757
});
5858

5959
// Don't resize
6060
test('doubleStageSizeImage', t => {
6161
const bitmapAdapter = new BitmapAdapter();
6262
const size = bitmapAdapter.getResizedWidthHeight(960, 720);
63-
t.equals(960, size.width);
64-
t.equals(720, size.height);
63+
t.equal(960, size.width);
64+
t.equal(720, size.height);
6565
t.end();
6666
});
6767

6868
// Fit to stage width
6969
test('wideImage', t => {
7070
const bitmapAdapter = new BitmapAdapter();
7171
const size = bitmapAdapter.getResizedWidthHeight(1000, 50);
72-
t.equals(960, size.width);
73-
t.equals(960 / 1000 * 50, size.height);
72+
t.equal(960, size.width);
73+
t.equal(960 / 1000 * 50, size.height);
7474
t.end();
7575
});
7676

7777
// Fit to stage height
7878
test('tallImage', t => {
7979
const bitmapAdapter = new BitmapAdapter();
8080
const size = bitmapAdapter.getResizedWidthHeight(50, 1000);
81-
t.equals(720, size.height);
82-
t.equals(720 / 1000 * 50, size.width);
81+
t.equal(720, size.height);
82+
t.equal(720 / 1000 * 50, size.width);
8383
t.end();
8484
});
8585

8686
// Fit to stage height
8787
test('largeImageHeightConstraint', t => {
8888
const bitmapAdapter = new BitmapAdapter();
8989
const size = bitmapAdapter.getResizedWidthHeight(1000, 1000);
90-
t.equals(720, size.height);
91-
t.equals(720 / 1000 * 1000, size.width);
90+
t.equal(720, size.height);
91+
t.equal(720 / 1000 * 1000, size.width);
9292
t.end();
9393
});
9494

9595
// Fit to stage width
9696
test('largeImageWidthConstraint', t => {
9797
const bitmapAdapter = new BitmapAdapter();
9898
const size = bitmapAdapter.getResizedWidthHeight(2000, 1000);
99-
t.equals(960, size.width);
100-
t.equals(960 / 2000 * 1000, size.height);
99+
t.equal(960, size.width);
100+
t.equal(960 / 2000 * 1000, size.height);
101101
t.end();
102102
});

packages/scratch-svg-renderer/test/fixup-svg-string.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ test('fixupSvgString should make parsing fixtures not throw', t => {
2222

2323
// Make sure undefineds aren't being written into the file
2424
t.equal(fixed.indexOf('undefined'), -1);
25-
t.notThrow(() => {
25+
t.doesNotThrow(() => {
2626
domParser.parseFromString(fixed, 'text/xml');
2727
});
2828
t.end();
@@ -36,7 +36,7 @@ test('fixupSvgString should correct namespace declarations bound to reserved nam
3636

3737
// Make sure undefineds aren't being written into the file
3838
t.equal(fixed.indexOf('undefined'), -1);
39-
t.notThrow(() => {
39+
t.doesNotThrow(() => {
4040
domParser.parseFromString(fixed, 'text/xml');
4141
});
4242
t.end();
@@ -45,7 +45,7 @@ test('fixupSvgString should correct namespace declarations bound to reserved nam
4545
test('fixupSvgString shouldn\'t correct non-attributes', t => {
4646
const dontFix = fixupSvgString('<text>xmlns:test="http://www/w3.org/XML/1998/namespace" is not an xmlns attribute</text>');
4747

48-
t.notEqual(dontFix.indexOf('http://www/w3.org/XML/1998/namespace'), -1);
48+
t.not(dontFix.indexOf('http://www/w3.org/XML/1998/namespace'), -1);
4949
t.end();
5050
});
5151

@@ -56,7 +56,7 @@ test('fixupSvgString should strip `svg:` prefix from tag names', t => {
5656
const fixed = fixupSvgString(svgString);
5757

5858
const checkPrefixes = element => {
59-
t.notEqual(element.prefix, 'svg');
59+
t.not(element.prefix, 'svg');
6060
// JSDOM doesn't have element.children, only element.childNodes
6161
if (element.childNodes) {
6262
// JSDOM's childNodes is not iterable, so for...of cannot be used here
@@ -69,7 +69,7 @@ test('fixupSvgString should strip `svg:` prefix from tag names', t => {
6969

7070
// Make sure undefineds aren't being written into the file
7171
t.equal(fixed.indexOf('undefined'), -1);
72-
t.notThrow(() => {
72+
t.doesNotThrow(() => {
7373
domParser.parseFromString(fixed, 'text/xml');
7474
});
7575

@@ -84,9 +84,9 @@ test('fixupSvgString should empty script tags', t => {
8484
.toString();
8585
const fixed = fixupSvgString(svgString);
8686
// Script tag should remain but have no contents.
87-
t.equals(fixed.indexOf('<script></script>'), 207);
87+
t.equal(fixed.indexOf('<script></script>'), 207);
8888
// The contents of the script tag (e.g. the alert) are no longer there.
89-
t.equals(fixed.indexOf('stuff inside'), -1);
89+
t.equal(fixed.indexOf('stuff inside'), -1);
9090
t.end();
9191
});
9292

@@ -96,7 +96,7 @@ test('fixupSvgString should empty script tags in onload', t => {
9696
.toString();
9797
const fixed = fixupSvgString(svgString);
9898
// Script tag should remain but have no contents.
99-
t.equals(fixed.indexOf('<script></script>'), 792);
99+
t.equal(fixed.indexOf('<script></script>'), 792);
100100
t.end();
101101
});
102102

@@ -106,9 +106,9 @@ test('fixupSvgString strips contents of metadata', t => {
106106
.toString();
107107
const fixed = fixupSvgString(svgString);
108108
// Metadata tag should still exist, it'll just be empty.
109-
t.equals(fixed.indexOf('<metadata></metadata>'), 207);
109+
t.equal(fixed.indexOf('<metadata></metadata>'), 207);
110110
// The contents of the metadata tag are gone.
111-
t.equals(fixed.indexOf('stuff inside'), -1);
111+
t.equal(fixed.indexOf('stuff inside'), -1);
112112
t.end();
113113
});
114114

@@ -118,7 +118,7 @@ test('fixupSvgString strips contents of metadata in onload', t => {
118118
.toString();
119119
const fixed = fixupSvgString(svgString);
120120
// Metadata tag should still exist, it'll just be empty.
121-
t.equals(fixed.indexOf('<metadata></metadata>'), 800);
121+
t.equal(fixed.indexOf('<metadata></metadata>'), 800);
122122
t.end();
123123
});
124124

@@ -128,9 +128,9 @@ test('fixupSvgString should correct invalid mime type', t => {
128128
const fixed = fixupSvgString(svgString);
129129

130130
// Make sure we replace an invalid mime type from Photoshop exported SVGs
131-
t.notEqual(svgString.indexOf('img/png'), -1);
131+
t.not(svgString.indexOf('img/png'), -1);
132132
t.equal(fixed.indexOf('img/png'), -1);
133-
t.notThrow(() => {
133+
t.doesNotThrow(() => {
134134
domParser.parseFromString(fixed, 'text/xml');
135135
});
136136
t.end();
@@ -139,6 +139,6 @@ test('fixupSvgString should correct invalid mime type', t => {
139139
test('fixupSvgString shouldn\'t correct non-image tags', t => {
140140
const dontFix = fixupSvgString('<text>data:img/png is not a mime type</text>');
141141

142-
t.notEqual(dontFix.indexOf('img/png'), -1);
142+
t.not(dontFix.indexOf('img/png'), -1);
143143
t.end();
144144
});

0 commit comments

Comments
 (0)