0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
astro/packages/astro/test/remote-css.test.js
Emanuele Stoppa ddf0f924b5
chore: move nodetest.js to test.js (#10142)
* chore: move `nodetest.js` to `test.js`

* chore: move `nodetest.js` to `test.js`

* remove script
2024-02-16 16:20:49 +00:00

28 lines
785 B
JavaScript

import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';
describe('Remote CSS', () => {
let fixture;
before(async () => {
fixture = await loadFixture({
root: './fixtures/remote-css/',
// test suite was authored when inlineStylesheets defaulted to never
build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
it('Includes all styles on the page', async () => {
const html = await fixture.readFile('/index.html');
const $ = cheerio.load(html);
const relPath = $('link').attr('href');
const css = await fixture.readFile(relPath);
assert.match(css, /https:\/\/unpkg.com\/open-props/);
assert.match(css, /body/);
});
});