basics.test.js 689 B

123456789101112131415161718192021222324
  1. import { loadFixture } from './test-utils.js';
  2. import * as assert from 'node:assert/strict';
  3. import { describe, it, before } from 'node:test';
  4. import { parseHTML } from 'linkedom';
  5. describe('Basics', () => {
  6. /** @type {import('./test-utils').Fixture} */
  7. let fixture;
  8. before(async () => {
  9. fixture = await loadFixture({
  10. root: './fixtures/basics/',
  11. });
  12. await fixture.build();
  13. });
  14. it('Slots are added without the slot attribute', async () => {
  15. const data = await fixture.readFile('/index.html');
  16. const { document } = parseHTML(data);
  17. const bar = document.querySelector('#foo');
  18. assert.notEqual(bar, undefined);
  19. assert.equal(bar.getAttribute('slot'), null);
  20. });
  21. });