Files
cocos-engine/tests/core/serialization/shared/cases/dictionary.test.ts
Leslie Leigh (李的序) 705c977fc9 Binary serialization (#8946)
* Binary serialization

* Update snapshots

* Update

* rename option ccon -> useCCON

* Missing script

* encodeCCONJson: chunks -> chunkURLs

* Update

* (de)serializeSymbol -> (de)serializeTag;

* CustomizedSerializable -> CustomSerializable

* _deserializePrimitiveObject -> _fillPlainObject

* Unify CCClass CCClassConstructor

* encodeCCONJson -> parseCCONJson

* Custom serializable

* Move (de)serializeSuper(This) from context into global

* property -> read(write)Property; (de)serializeThis(Super) -> (read)writeThis(Super)

* CI and lint

* Mock cc env
2021-07-15 10:21:25 +08:00

29 lines
703 B
TypeScript

import { PORTS_BOTH_DYNAMIC_COMPILED, testEachPort } from "../port";
import { runTest } from "../utils";
const value = Object.assign(Object.create(null), {
foo: 'a',
bar: Object.assign(Object.create(null), {
baz: 2,
__baz: 3,
}),
__foo: 'b',
});
testEachPort(PORTS_BOTH_DYNAMIC_COMPILED, async (port) => {
await runTest(
__filename,
port,
value,
(serialized) => {
expect(serialized).toHaveProperty('foo', 'a');
expect(serialized).not.toHaveProperty('__foo');
expect(serialized).toHaveProperty('bar.baz', 2);
expect(serialized).not.toHaveProperty('bar.__baz');
},
);
});