mirror of
https://gitee.com/newgateway/vtj.git
synced 2026-06-23 19:53:25 +08:00
21 lines
585 B
TypeScript
21 lines
585 B
TypeScript
import { expect, describe, test } from 'vitest';
|
|
import { parseState } from '../../src/parser/state';
|
|
|
|
describe('parseState', () => {
|
|
test('should parse state with string value', () => {
|
|
const result = parseState({ title: 'hello' });
|
|
expect(result).toContain('title:hello');
|
|
});
|
|
|
|
test('should parse state with JSExpression value', () => {
|
|
const result = parseState({
|
|
list: { type: 'JSExpression', value: '[]' }
|
|
});
|
|
expect(result).toContain('list:[]');
|
|
});
|
|
|
|
test('should handle empty state', () => {
|
|
expect(parseState({})).toEqual([]);
|
|
});
|
|
});
|