amis/__tests__/utils/tpl.test.ts

17 lines
368 B
TypeScript
Raw Normal View History

2019-04-30 11:11:25 +08:00
import {
filter
} from '../../src/utils/tpl';
import '../../src/utils/tpl-builtin';
import '../../src/utils/tpl-lodash';
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');
})