@reactml/loader
Version:
Webpack loader for react markup language.
25 lines (20 loc) • 688 B
JavaScript
const {
selectPart,
parseSFCParts,
} = require('../parts');
const { readFileSync } = require('fs');
const { join } = require('path');
describe('parts', () => {
it('should parse basic rml', () => {
const rml = readFileSync(join(__dirname, './basic.rml'), 'utf-8');
const parts = parseSFCParts(rml);
const script = selectPart(parts, 'script');
expect(script).toMatchSnapshot();
const template = selectPart(parts, 'template');
expect(template).toMatchSnapshot();
const style = selectPart(parts, 'style');
expect(style).toMatchSnapshot();
const importLinks = selectPart(parts, 'importLinks');
expect(importLinks).toMatchSnapshot();
});
});