@kstasi/jest-tolk
Version:
<p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/tonkite/tonkite/main/assets/logo-dark.svg"> <img alt="tonkite logo" src="https://raw.githubusercontent.com/tonkite/tonkite/main/a
62 lines (61 loc) • 2.18 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const annotations_1 = require("./annotations");
describe('extractAnnotationsFromDocBlock()', () => {
it('extracts @exitCode', () => {
expect((0, annotations_1.extractAnnotationsFromDocBlock)('// @exitCode 3010 (an ignored comment)')).toEqual({
exitCode: 3010,
});
});
it('extracts @scope', () => {
expect((0, annotations_1.extractAnnotationsFromDocBlock)('// @scope myCustomScope')).toEqual({
scope: 'myCustomScope',
});
});
it('extracts @balance', () => {
expect((0, annotations_1.extractAnnotationsFromDocBlock)('// @balance 20000000')).toEqual({
balance: 20000000n,
});
});
it('extracts @gasLimit', () => {
expect((0, annotations_1.extractAnnotationsFromDocBlock)('// @gasLimit 50000')).toEqual({
gasLimit: 50000,
});
});
it('extracts @unixTime', () => {
expect((0, annotations_1.extractAnnotationsFromDocBlock)('// @unixTime 1735231203')).toEqual({
unixTime: 1735231203,
});
});
it('extracts @test', () => {
expect((0, annotations_1.extractAnnotationsFromDocBlock)('// @test')).toEqual({
test: true,
});
});
it('extracts @skip', () => {
expect((0, annotations_1.extractAnnotationsFromDocBlock)('// @skip')).toEqual({
skip: true,
});
});
it('extracts @todo', () => {
expect((0, annotations_1.extractAnnotationsFromDocBlock)('// @todo')).toEqual({
todo: true,
});
});
it('extracts @runs', () => {
expect((0, annotations_1.extractAnnotationsFromDocBlock)('// @runs 100')).toEqual({
runs: 100,
});
});
it('extracts @fuzz', () => {
expect((0, annotations_1.extractAnnotationsFromDocBlock)('// @fuzz')).toEqual({
fuzz: true,
});
});
it('extracts @fuzz with a tlb', () => {
expect((0, annotations_1.extractAnnotationsFromDocBlock)('// @fuzz tlb')).toEqual({
fuzz: true,
fuzzTlb: 'tlb',
});
});
});