[ci] format
This commit is contained in:
parent
44bacd2011
commit
efa6f7d662
1 changed files with 14 additions and 12 deletions
|
@ -3,7 +3,7 @@ import cheerio from 'cheerio';
|
||||||
import { loadFixture } from './test-utils.js';
|
import { loadFixture } from './test-utils.js';
|
||||||
|
|
||||||
let fixture;
|
let fixture;
|
||||||
const IMPORTED_ASTRO_COMPONENT_ID = 'imported-astro-component'
|
const IMPORTED_ASTRO_COMPONENT_ID = 'imported-astro-component';
|
||||||
|
|
||||||
describe('Imported markdown CSS', function () {
|
describe('Imported markdown CSS', function () {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
|
@ -25,11 +25,11 @@ describe('Imported markdown CSS', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Compiles styles for Astro components within imported markdown', () => {
|
it('Compiles styles for Astro components within imported markdown', () => {
|
||||||
const importedAstroComponent = $(`#${IMPORTED_ASTRO_COMPONENT_ID}`)?.[0]
|
const importedAstroComponent = $(`#${IMPORTED_ASTRO_COMPONENT_ID}`)?.[0];
|
||||||
expect(importedAstroComponent?.name).to.equal('h2')
|
expect(importedAstroComponent?.name).to.equal('h2');
|
||||||
const cssClass = $(importedAstroComponent).attr('class')?.split(/\s+/)?.[0]
|
const cssClass = $(importedAstroComponent).attr('class')?.split(/\s+/)?.[0];
|
||||||
|
|
||||||
expect(bundledCSS).to.match(new RegExp(`h2.${cssClass}{color:#00f}`))
|
expect(bundledCSS).to.match(new RegExp(`h2.${cssClass}{color:#00f}`));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('dev', () => {
|
describe('dev', () => {
|
||||||
|
@ -47,11 +47,13 @@ describe('Imported markdown CSS', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Compiles styles for Astro components within imported markdown', async () => {
|
it('Compiles styles for Astro components within imported markdown', async () => {
|
||||||
const importedAstroComponent = $(`#${IMPORTED_ASTRO_COMPONENT_ID}`)?.[0]
|
const importedAstroComponent = $(`#${IMPORTED_ASTRO_COMPONENT_ID}`)?.[0];
|
||||||
expect(importedAstroComponent?.name).to.equal('h2')
|
expect(importedAstroComponent?.name).to.equal('h2');
|
||||||
const cssClass = $(importedAstroComponent).attr('class')?.split(/\s+/)?.[0]
|
const cssClass = $(importedAstroComponent).attr('class')?.split(/\s+/)?.[0];
|
||||||
|
|
||||||
const astroCSSHREF = $('link[rel=stylesheet][href^=/src/components/Visual.astro]').attr('href');
|
const astroCSSHREF = $('link[rel=stylesheet][href^=/src/components/Visual.astro]').attr(
|
||||||
|
'href'
|
||||||
|
);
|
||||||
const css = await fixture.fetch(astroCSSHREF.replace(/^\/?/, '/')).then((res) => res.text());
|
const css = await fixture.fetch(astroCSSHREF.replace(/^\/?/, '/')).then((res) => res.text());
|
||||||
expect(css).to.match(new RegExp(`h2.${cssClass}{color:#00f}`));
|
expect(css).to.match(new RegExp(`h2.${cssClass}{color:#00f}`));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue