mirror of
https://github.com/cocos/cocos-engine.git
synced 2026-09-08 16:48:15 +08:00
* add unit test * add more unit test * refine * add test * add more unit test * add more unit test * more change * add commit * add unit test * commit package-lock.json * revert some * refine code * add more test * fix bugs * fix bugs
13 lines
454 B
TypeScript
13 lines
454 B
TypeScript
|
|
import Cache from '../../cocos/core/asset-manager/cache'
|
|
test('operation', function () {
|
|
const cache = new Cache();
|
|
cache.add('test 1', {url: 'resources/image'});
|
|
expect(cache.count).toBe(1);
|
|
expect(cache.get('test 1').url).toBe('resources/image');
|
|
expect(cache.get('')).toBeFalsy();
|
|
cache.add('test 1', {url: 'resources/image2'});
|
|
expect(cache.count).toBe(1);
|
|
cache.remove('test 1');
|
|
expect(cache.count).toBe(0);
|
|
}); |