Commit 74ea4157 authored by nanahira's avatar nanahira

add serializable test

parent a4f82aa1
Pipeline #7568 passed with stages
in 1 minute and 45 seconds
......@@ -29,6 +29,15 @@ describe('Schema registration', () => {
expect(schema.dict.foo.type).toBe('string');
});
it('should be serializable', () => {
const schema = Config as Schema<Config>;
const plainObject: Partial<Schema<Config>> = JSON.parse(
JSON.stringify(schema),
);
expect(plainObject.type).toBe('object');
expect(plainObject.dict.foo.type).toBe('string');
});
it('should put default value', () => {
expect(new Config({}).foo).toBe('bar');
expect(new Config({ foo: 'baz' }).foo).toBe('baz');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment