Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed Mar 10, 2022
1 parent 67b860b commit 002c35f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions packages/astro/test/0-css.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,10 @@ describe('CSS', function () {
describe('JSX', () => {
it('.css', async () => {
const el = $('#react-css');

// 1. check HTML
expect(el.attr('class')).to.include('react-title');

// 2. check CSS
expect(bundledCSS).to.include('.react-title{');
expect(bundledCSS).to.include('.react-title');
});

it('.module.css', async () => {
Expand Down Expand Up @@ -196,7 +194,7 @@ describe('CSS', function () {
expect(el.attr('class')).to.include(moduleClass);

// 2. check CSS
expect(bundledCSS).to.include(`${moduleClass}{`);
expect(bundledCSS).to.match(new RegExp(`.${moduleClass}[^{]*{font-family:cursive}`));
});

it('<style lang="sass">', async () => {
Expand Down Expand Up @@ -230,7 +228,7 @@ describe('CSS', function () {
expect(el.attr('class')).to.include('svelte-css');

// 2. check CSS
expect(bundledCSS).to.match(new RegExp(`.svelte-css.${scopedClass}[^{]*{font-family:"Comic Sans MS"`));
expect(bundledCSS).to.match(new RegExp(`.svelte-css.${scopedClass}[^{]*{font-family:Comic Sans MS`));
});

it('<style lang="sass">', async () => {
Expand All @@ -242,7 +240,7 @@ describe('CSS', function () {
expect(el.attr('class')).to.include('svelte-sass');

// 2. check CSS
expect(bundledCSS).to.match(new RegExp(`.svelte-sass.${scopedClass}[^{]*{font-family:"Comic Sans MS"`));
expect(bundledCSS).to.match(new RegExp(`.svelte-sass.${scopedClass}[^{]*{font-family:Comic Sans MS`));
});

it('<style lang="scss">', async () => {
Expand All @@ -254,7 +252,7 @@ describe('CSS', function () {
expect(el.attr('class')).to.include('svelte-scss');

// 2. check CSS
expect(bundledCSS).to.match(new RegExp(`.svelte-scss.${scopedClass}[^{]*{font-family:"Comic Sans MS"`));
expect(bundledCSS).to.match(new RegExp(`.svelte-scss.${scopedClass}[^{]*{font-family:Comic Sans MS`));
});
});
});
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/test/postcss.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ describe('PostCSS', () => {
});

it('works in JSX', () => {
expect(bundledCSS).to.match(new RegExp(`.solid${PREFIXED_CSS}`));
expect(bundledCSS).to.match(new RegExp(`.solid[^{]*${PREFIXED_CSS}`));
});

it('works in Vue', () => {
expect(bundledCSS).to.match(new RegExp(`.vue${PREFIXED_CSS}`));
expect(bundledCSS).to.match(new RegExp(`.vue[^{]*${PREFIXED_CSS}`));
});

it('works in Svelte', () => {
Expand Down

0 comments on commit 002c35f

Please sign in to comment.