Skip to content

Commit 2dbf983

Browse files
committed
npm: Update dependencies and snapshots.
Make necessary changes to allow updating.
1 parent 5444867 commit 2dbf983

4 files changed

Lines changed: 120 additions & 181 deletions

File tree

npm/firmware/__snapshots__/index.test.ts.snap

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`missing main.py 1`] = `
44
Uint8Array [
@@ -106,14 +106,14 @@ Uint8Array [
106106
`;
107107

108108
exports[`missing main.py 2`] = `
109-
Object {
109+
{
110110
"checksum-type": "sum",
111111
"device-id": 64,
112112
"firmware-version": "v3.0.0a10",
113113
"max-firmware-size": 108544,
114114
"metadata-version": "1.0.0",
115115
"mpy-abi-version": 5,
116-
"mpy-cross-options": Array [
116+
"mpy-cross-options": [
117117
"-mno-unicode",
118118
],
119119
"user-mpy-offset": 100008,
@@ -139,11 +139,11 @@ MIT
139139
140140
MIT License Copyright (c) <year> <copyright holders>
141141
142-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\"Software\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
142+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
143143
144144
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
145145
146-
THE SOFTWARE IS PROVIDED \\"AS IS\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
146+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
147147
148148
------------------------------------------------------------------------------------------------------------------------
149149
"
@@ -255,14 +255,14 @@ Uint8Array [
255255
`;
256256
257257
exports[`reading data works 2`] = `
258-
Object {
258+
{
259259
"checksum-type": "sum",
260260
"device-id": 64,
261261
"firmware-version": "v3.0.0a10",
262262
"max-firmware-size": 108544,
263263
"metadata-version": "1.0.0",
264264
"mpy-abi-version": 5,
265-
"mpy-cross-options": Array [
265+
"mpy-cross-options": [
266266
"-mno-unicode",
267267
],
268268
"user-mpy-offset": 100008,
@@ -275,7 +275,7 @@ from pybricks.tools import wait
275275
276276
print(version)
277277
wait(5000)
278-
print(\\"Hello, World!\\")
278+
print("Hello, World!")
279279
"
280280
`;
281281
@@ -296,11 +296,11 @@ MIT
296296
297297
MIT License Copyright (c) <year> <copyright holders>
298298
299-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\"Software\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
299+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
300300
301301
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
302302
303-
THE SOFTWARE IS PROVIDED \\"AS IS\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
303+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
304304
305305
------------------------------------------------------------------------------------------------------------------------
306306
"

npm/firmware/index.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ test('missing firmware-base.bin', async () => {
3333
path.resolve(__dirname, '__tests__', 'movehub-no-firmware-base.zip')
3434
);
3535
try {
36-
await FirmwareReader.load(file);
36+
await FirmwareReader.load(file.buffer);
3737
fail('FirmwareReader.load() should have failed');
3838
} catch (err: any) {
3939
expect(err.name).toMatch('FirmwareReaderError');
@@ -46,7 +46,7 @@ test('missing firmware.metadata.json', async () => {
4646
path.resolve(__dirname, '__tests__', 'movehub-no-metadata.zip')
4747
);
4848
try {
49-
await FirmwareReader.load(file);
49+
await FirmwareReader.load(file.buffer);
5050
fail('FirmwareReader.load() should have failed');
5151
} catch (err: any) {
5252
expect(err.name).toMatch('FirmwareReaderError');
@@ -58,7 +58,7 @@ test('missing main.py', async () => {
5858
var file = await readFile(
5959
path.resolve(__dirname, '__tests__', 'movehub-no-main-py.zip')
6060
);
61-
const reader = await FirmwareReader.load(file);
61+
const reader = await FirmwareReader.load(file.buffer);
6262
expect(await reader.readFirmwareBase()).toMatchSnapshot();
6363
expect(await reader.readMetadata()).toMatchSnapshot();
6464
expect(await reader.readMainPy()).toMatchSnapshot();
@@ -70,7 +70,7 @@ test('missing ReadMe_OSS.txt', async () => {
7070
path.resolve(__dirname, '__tests__', 'movehub-no-readme-oss.zip')
7171
);
7272
try {
73-
await FirmwareReader.load(file);
73+
await FirmwareReader.load(file.buffer);
7474
fail('FirmwareReader.load() should have failed');
7575
} catch (err: any) {
7676
expect(err.name).toMatch('FirmwareReaderError');
@@ -82,7 +82,7 @@ test('reading data works', async () => {
8282
var file = await readFile(
8383
path.resolve(__dirname, '__tests__', 'movehub.zip')
8484
);
85-
var reader = await FirmwareReader.load(file);
85+
var reader = await FirmwareReader.load(file.buffer);
8686
expect(await reader.readFirmwareBase()).toMatchSnapshot();
8787
expect(await reader.readMetadata()).toMatchSnapshot();
8888
expect(await reader.readMainPy()).toMatchSnapshot();
@@ -137,6 +137,6 @@ describe.each([
137137
});
138138

139139
test('old firmware throws', () => {
140-
expect(() => encodeHubName('', {} as FirmwareMetadata)).toThrowError();
140+
expect(() => encodeHubName('', {} as FirmwareMetadata)).toThrow();
141141
});
142142
});

npm/firmware/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
},
2727
"devDependencies": {
2828
"@types/jest": "^30.0.0",
29+
"@types/node": "^20.0.0",
2930
"jest": "^30.3.0",
3031
"ts-jest": "^29.4.6",
3132
"typescript": "^5.9.3"

0 commit comments

Comments
 (0)