mirror of
https://gitee.com/newgateway/vtj.git
synced 2026-06-23 19:53:25 +08:00
21 lines
581 B
TypeScript
21 lines
581 B
TypeScript
import { expect, describe, test } from 'vitest';
|
|
import { parseInject } from '../../src/parser/inject';
|
|
|
|
describe('parseInject', () => {
|
|
test('should parse inject array with from', () => {
|
|
const result = parseInject([
|
|
{ name: 'theme', from: 'theme', default: 'light' }
|
|
]);
|
|
expect(result[0]).toContain('theme');
|
|
expect(result[0]).toContain("from: 'theme'");
|
|
});
|
|
|
|
test('should handle empty inject', () => {
|
|
expect(parseInject([])).toEqual([]);
|
|
});
|
|
|
|
test('should handle undefined', () => {
|
|
expect(parseInject(undefined)).toEqual([]);
|
|
});
|
|
});
|