Skip to content

Commit

Permalink
chore: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Nov 29, 2024
1 parent 731bf50 commit a09229e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/astro/test/content-layer.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { promises as fs } from 'node:fs';
import { promises as fs, existsSync } from 'node:fs';
import { sep } from 'node:path';
import { sep as posixSep } from 'node:path/posix';
import { after, before, describe, it } from 'node:test';
Expand Down Expand Up @@ -313,6 +313,13 @@ describe('Content Layer', () => {
devServer?.stop();
});


it('Generates content types files', async () => {
assert.ok(existsSync(new URL('./.astro/content.d.ts', fixture.config.root)));
const data = await fs.readFile(new URL('./.astro/types.d.ts', fixture.config.root), 'utf-8');
assert.match(data, /<reference path="content.d.ts"/);
});

it('Returns custom loader collection', async () => {
assert.ok(json.hasOwnProperty('customLoader'));
assert.ok(Array.isArray(json.customLoader));
Expand Down

0 comments on commit a09229e

Please sign in to comment.