amis2/__tests__/utils/tpl.test.ts
2019-04-30 11:11:25 +08:00

17 lines
368 B
TypeScript

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');
})