Skip to content

Commit 32be021

Browse files
committed
fixup!
1 parent 1b1fa13 commit 32be021

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

src/utils/parser/__tests__/index.test.mjs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,7 @@ describe('transformTypeToReferenceLink', () => {
2323
);
2424
});
2525

26-
it('should transform a prefixed type into a Markdown link', () => {
27-
strictEqual(
28-
transformTypeToReferenceLink('prefix.Type'),
29-
'[`<prefix.Type>`](prefix.html#class-prefixtype)'
30-
);
31-
});
32-
33-
it('should accept a type map', () => {
26+
it('should transform a type into a Markdown link', () => {
3427
strictEqual(
3528
transformTypeToReferenceLink('SomeOtherType', {
3629
SomeOtherType: 'fromTypeMap',

src/utils/queries/__tests__/index.test.mjs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { strictEqual, deepStrictEqual } from 'node:assert';
22
import { describe, it } from 'node:test';
33

4+
import typeMap from '../../parser/typeMap.json' with { type: 'json' };
45
import createQueries from '../index.mjs';
56

67
describe('createQueries', () => {
8+
const queries = createQueries(typeMap);
9+
710
it('should add YAML metadata correctly', () => {
8-
const queries = createQueries();
911
const node = { value: 'type: test\nname: test\n' };
1012
const apiEntryMetadata = {
1113
updateProperties: properties => {
@@ -17,7 +19,6 @@ describe('createQueries', () => {
1719

1820
// valid type
1921
it('should update type to reference correctly', () => {
20-
const queries = createQueries();
2122
const node = {
2223
value: 'This is a {string} type.',
2324
position: { start: 0, end: 0 },
@@ -35,7 +36,6 @@ describe('createQueries', () => {
3536
});
3637

3738
it('should update type to reference not correctly if no match', () => {
38-
const queries = createQueries();
3939
const node = {
4040
value: 'This is a {test} type.',
4141
position: { start: 0, end: 0 },
@@ -47,7 +47,6 @@ describe('createQueries', () => {
4747
});
4848

4949
it('should add heading metadata correctly', () => {
50-
const queries = createQueries();
5150
const node = {
5251
depth: 2,
5352
children: [{ type: 'text', value: 'Test Heading' }],
@@ -74,14 +73,12 @@ describe('createQueries', () => {
7473
});
7574

7675
it('should update markdown link correctly', () => {
77-
const queries = createQueries();
7876
const node = { type: 'link', url: 'test.md#heading' };
7977
queries.updateMarkdownLink(node);
8078
strictEqual(node.url, 'test.html#heading');
8179
});
8280

8381
it('should update link reference correctly', () => {
84-
const queries = createQueries();
8582
const node = { type: 'linkReference', identifier: 'test' };
8683
const definitions = [{ identifier: 'test', url: 'test.html#test' }];
8784
queries.updateLinkReference(node, definitions);
@@ -90,7 +87,6 @@ describe('createQueries', () => {
9087
});
9188

9289
it('should add stability index metadata correctly', () => {
93-
const queries = createQueries();
9490
const node = {
9591
type: 'blockquote',
9692
children: [

0 commit comments

Comments
 (0)