');
const match = G.match;
expect(match[0][0].value).toBe('1');
})
test('$.find: simple1 html code find attr key', () => {
const G = $(hc1, config.html).find('
');
const match = G.match;
expect(match[0][0].value).toBe('id');
})
test('$.find: simple1 html code find DOCTYPE ', () => {
const G = $(hc1, config.html).find('');
const match = G.match;
// 无$_$ 无match返回也合理
// expect(match[0].value).toBe('');
})
test('$.find: script code result should be ok', () => {
const G = $(hc1, config.html);
const result = G.find('');
const match = result.match;
expect(match[0][0].value).toBe(` var a = '1';`);
})
test('$.find: style code result should be ok', () => {
const G = $(hc1, config.html);
const result = G.find('');
const match = result.match;
expect(match.indexOf('color: #000;') > -1).toBeTruthy();
})
test('$.find: comment code result should be ok', () => {
const G = $(hc1, config.html);
const result = G.find('');
const match = result.match;
expect(match).toBe(` comment test `);
})
test('$.find: replace html tag result should be ok', () => {
const G = $(hc1, config.html);
const code = G.find('
').each((ast)=>{
ast.node.content.name = 'mx-form'
}).root().generate();
expect(code.indexOf('