mirror of
https://github.com/cocos/cocos-engine.git
synced 2026-09-07 00:02:53 +08:00
* unit test for ts * Fix ts-jest warnings * Remove puppeteer for now * fix physics define and jest config for windows * Replace Node ref with INode ref * Fix ci issue * Fix * tweak * tweak * Fix vscode launcher * now physics framework export all physics component (#28) * tweaks
21 lines
638 B
JavaScript
21 lines
638 B
JavaScript
if (TestEditorExtends) {
|
|
|
|
test('undo destroy', function () {
|
|
var Type = cc.Class({
|
|
extends: cc.Object
|
|
});
|
|
var obj1 = new Type();
|
|
var record = _Scene._UndoImpl.recordObject(obj1);
|
|
obj1.destroy();
|
|
_Scene._UndoImpl.restoreObject(obj1, record);
|
|
cc.Object._deferredDestroy();
|
|
ok(obj1.isValid, 'it should be valid if restored before _deferredDestroy');
|
|
|
|
obj1.destroy();
|
|
cc.Object._deferredDestroy();
|
|
_Scene._UndoImpl.restoreObject(obj1, record);
|
|
ok(obj1.isValid, 'it should be valid if restored after _deferredDestroy');
|
|
});
|
|
|
|
}
|