astro/packages/astro/test/builtins.test.js
Matthew Phillips f14c1fb4e4
Fix formatting issues caused by release (#2261)
* Run formatting on the release notes

* Update version in test due to releases GH
2021-12-23 12:41:55 -05:00

27 lines
743 B
JavaScript

import { expect } from 'chai';
import cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';
let fixture;
before(async () => {
fixture = await loadFixture({ projectRoot: './fixtures/builtins/' });
await fixture.build();
});
describe('Node builtins', () => {
it('Can be used with the node: prefix', async () => {
const html = await fixture.readFile('/index.html');
const $ = cheerio.load(html);
expect($('#version').text()).to.equal('1.2.0');
expect($('#dep-version').text()).to.equal('0.1.0');
});
it('Can also be used with the non-prefixed version', async () => {
const html = await fixture.readFile('/bare/index.html');
const $ = cheerio.load(html);
expect($('h1').text()).to.equal('true');
});
});