amis2/packages/amis-core/__tests__/tokenize.test.ts
2022-06-01 15:06:00 +08:00

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