Skip to content

Commit

Permalink
Fix a bad TWAssetUtil test
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed Jan 3, 2024
1 parent a8639af commit a96f92b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/unit/tw_asset_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,23 @@ test('getByMd5ext from zip subdirectory', t => {
});

test('getByMd5ext from storage with null zip', t => {
t.plan(4);

const rt = new Runtime();
rt.attachStorage(makeTestStorage());

rt.storage.load = (assetType, md5, ext) => {
t.equal(assetType, rt.storage.AssetType.SVG);
t.equal(md5, '00000000000000000000000000000000');
t.equal(ext, 'svg');
t.end();
return Promise.resolve({
fromStorage: true
});
};

AssetUtil.getByMd5ext(rt, null, rt.storage.AssetType.SVG, '00000000000000000000000000000000.svg');
AssetUtil.getByMd5ext(rt, null, rt.storage.AssetType.SVG, '00000000000000000000000000000000.svg')
.then(asset => {
t.ok(asset.fromStorage);
t.end();
});
});

0 comments on commit a96f92b

Please sign in to comment.