scratch-storage 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "scratch-storage",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "Load and store project and asset files for Scratch 3.0",
5
5
  "license": "BSD-3-Clause",
6
6
  "homepage": "https://github.com/LLK/scratch-storage#readme",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "https://github.com/LLK/scratch-storage.git",
10
- "sha": "0537bdad85576ae09cf31765bd65b7450f31308b"
10
+ "sha": "135b4dc424b873795602d6e2a112453128c2745b"
11
11
  },
12
12
  "main": "./dist/node/scratch-storage.js",
13
- "browser": "./src/index.js",
13
+ "browser": "./dist/web/scratch-storage.js",
14
14
  "scripts": {
15
15
  "build": "webpack --progress --colors --bail",
16
16
  "coverage": "tap ./test/{unit,integration}/*.js --coverage --coverage-report=lcov",
@@ -1,6 +1,13 @@
1
1
  const md5 = require('js-md5');
2
2
 
3
- const ScratchStorage = require('../../src/index.js');
3
+ const ScratchStorage = require('../../dist/node/scratch-storage');
4
+
5
+ // Hash and file size of each default asset
6
+ const knownSizes = {
7
+ '8e768a5a5a01891b05c01c9ca15eb6aa': 255,
8
+ 'b586745b98e94d7574f7f7b48d831e20': 46,
9
+ 'e5cb3b2aa4e1a9b4c735c3415e507e66': 925
10
+ };
4
11
 
5
12
  const getDefaultAssetTypes = storage => {
6
13
  const defaultAssetTypes = [storage.AssetType.ImageBitmap, storage.AssetType.ImageVector, storage.AssetType.Sound];
@@ -42,6 +49,7 @@ test('load', () => {
42
49
  expect(asset.assetId).toStrictEqual(id);
43
50
  expect(asset.assetType).toStrictEqual(assetType);
44
51
  expect(asset.data.length).toBeTruthy();
52
+ expect(asset.data.length).toBe(knownSizes[id]);
45
53
  expect(md5(asset.data)).toBe(id);
46
54
  };
47
55
  for (const assetType of defaultAssetTypes) {