mirror of
https://github.com/vale981/grapher
synced 2025-03-06 01:51:38 -05:00
19 lines
596 B
JavaScript
Executable file
19 lines
596 B
JavaScript
Executable file
import { assert } from 'chai';
|
|
import astToBody, { Symbols } from '../lib/astToBody';
|
|
import ast from './ast.js';
|
|
|
|
describe('#astToBody', function() {
|
|
it('Should properly parse the body with arguments and such', function() {
|
|
const result = astToBody(ast);
|
|
|
|
assert.equal(result.fullname, 1);
|
|
assert.isObject(result.comments);
|
|
|
|
const commentArgs = result.comments[Symbols.ARGUMENTS];
|
|
assert.equal(commentArgs.approved, true);
|
|
|
|
assert.equal(result.comments.text, 1);
|
|
assert.isObject(result.comments.user);
|
|
assert.equal(result.comments.user.firstname, 1);
|
|
});
|
|
});
|