amis2/packages/amis/__tests__/utils/tpl.test.ts
2022-06-02 10:00:09 +08:00

20 lines
323 B
TypeScript

import {filter} from '../../src';
import '../../src';
import '../../src';
test('filter', () => {
expect(
filter('xxx_a=${a}&b=${b}', {
a: 1,
b: 2
})
).toEqual('xxx_a=1&b=2');
expect(
filter('xxx_a=<%= data.a%>&b=<%= data.b%>', {
a: 1,
b: 2
})
).toEqual('xxx_a=1&b=2');
});