本文整理匯總了TypeScript中interweave/lib/testUtils.TOKEN_LOCATIONS類的典型用法代碼示例。如果您正苦於以下問題:TypeScript TOKEN_LOCATIONS類的具體用法?TypeScript TOKEN_LOCATIONS怎麽用?TypeScript TOKEN_LOCATIONS使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了TOKEN_LOCATIONS類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
VALID_HASHTAGS.forEach(hashtag => {
TOKEN_LOCATIONS.forEach((location, i) => {
it(`for: ${hashtag} - ${location}`, () => {
parser.keyIndex = -1; // Reset for easier testing
const tokenString = location.replace(/\{token\}/g, hashtag);
const actual = parser.applyMatchers(tokenString, parentConfig);
if (i === 0) {
expect(actual).toBe(createExpectedToken(hashtag, createHashtag, 0));
} else {
expect(actual).toEqual(createExpectedToken(hashtag, createHashtag, i));
}
});
});
});
示例2: it
VALID_URLS.forEach(urlParams => {
TOKEN_LOCATIONS.forEach((location, i) => {
it(`for: ${urlParams.url} - ${location}`, () => {
parser.keyIndex = -1; // Reset for easier testing
const tokenString = location.replace(/\{token\}/g, urlParams.url);
const actual = parser.applyMatchers(tokenString, parentConfig);
if (i === 0) {
expect(actual).toBe(createExpectedToken(urlParams, createUrl, 0));
} else {
expect(actual).toEqual(createExpectedToken(urlParams, createUrl, i));
}
});
});
});