@tonkite/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
55 lines (54 loc) • 1.63 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const source_code_1 = require("./source-code");
describe('extractGetMethods', () => {
it('extracts get-methods names', () => {
expect((0, source_code_1.extractGetMethods)(`
get test_case_1() {}
`)).resolves.toEqual([
{
methodName: 'test_case_1',
parameters: [],
},
]);
});
it('extracts get-methods @method_id', () => {
expect((0, source_code_1.extractGetMethods)(`
@method_id(5858)
get test_case_1() {}
`)).resolves.toEqual([
{
methodName: 'test_case_1',
methodId: 5858,
parameters: [],
},
]);
});
it('extracts get-methods doc-blocks', () => {
expect((0, source_code_1.extractGetMethods)(`
// @exitCode 50
// @gasLimit
get test_case_1() {}
`)).resolves.toEqual([
{
methodName: 'test_case_1',
docBlock: '@exitCode 50\n@gasLimit',
parameters: [],
},
]);
});
it('extracts get-methods arguments', () => {
expect((0, source_code_1.extractGetMethods)(`
get test_case_1(a: uint3, b: bool, c: address) {}
`)).resolves.toEqual([
{
methodName: 'test_case_1',
parameters: [
{ name: 'a', type: 'uint3' },
{ name: 'b', type: 'bool' },
{ name: 'c', type: 'address' }
],
},
]);
});
});