mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-15 01:11:15 +08:00
27 lines
385 B
TypeScript
27 lines
385 B
TypeScript
import {tokenize} from '../src/utils/tpl-builtin';
|
|
|
|
test(`tokenize:null`, () => {
|
|
expect(
|
|
tokenize('abc${a}', {
|
|
a: ''
|
|
})
|
|
).toBe('abc');
|
|
expect(
|
|
tokenize('abc${a}', {
|
|
a: null
|
|
})
|
|
).toBe('abc');
|
|
|
|
expect(
|
|
tokenize('abc${a}', {
|
|
a: undefined
|
|
})
|
|
).toBe('abc');
|
|
|
|
expect(
|
|
tokenize('abc${a}', {
|
|
a: 0
|
|
})
|
|
).toBe('abc0');
|
|
});
|