You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/compiler/parse/__test__.js

36 lines
594 B

import * as assert from 'assert';
import parse from './index.js';
describe( 'parse', () => {
it( 'is a function', () => {
assert.equal( typeof parse, 'function' );
});
it( 'parses a single element', () => {
const template = `<span>test</span>`;
assert.deepEqual( parse( template ), {
start: 0,
end: 17,
type: 'Fragment',
children: [
{
start: 0,
end: 17,
type: 'Element',
name: 'span',
attributes: {},
children: [
{
start: 6,
end: 10,
type: 'Text',
data: 'test'
}
]
}
]
});
});
});