@ryusei/light
Version:
<div align="center"> <a href="https://light.ryuseijs.com"> <img alt="RyuseiLight" src="https://light.ryuseijs.com/images/svg/logo.svg" width="70"> </a>
24 lines (21 loc) • 771 B
text/typescript
import { Token } from '../../../src/js/types';
import { toBeTokenized } from '../toBeTokenized/toBeTokenized';
/**
* The jest matcher to check if the code is tokenized to expected tokens or not.
* The depth parameter must be matched.
*
* @since 1.0.2
*
* @param received - A received string.
* @param lang - A language name.
* @param expectedTokens - Expected tokens with depth.
* @param ignoreSpaces - Optional. Whether to ignore whitespaces or not. The default value is true.
*/
export function toBeTokenizedWithDepth(
received: string,
lang: string,
expectedTokens: Required<Token>[],
ignoreSpaces = true,
): jest.CustomMatcherResult {
return toBeTokenized.call( this, received, lang, expectedTokens, ignoreSpaces, 'depth' );
}