UNPKG

2.06 kBJavaScriptView Raw
1"use strict";
2var __importDefault = (this && this.__importDefault) || function (mod) {
3 return (mod && mod.__esModule) ? mod : { "default": mod };
4};
5Object.defineProperty(exports, "__esModule", { value: true });
6const path_1 = __importDefault(require("path"));
7const fs_1 = __importDefault(require("fs"));
8const vitest_1 = require("vitest");
9// File hierarchy: __testfixtures__ / some-test-case / input.*
10const inputRegExp = /^input\..*$/;
11(0, vitest_1.describe)('angular component properties', () => {
12 const fixturesDir = path_1.default.join(__dirname, '__testfixtures__');
13 fs_1.default.readdirSync(fixturesDir, { withFileTypes: true }).forEach((testEntry) => {
14 if (testEntry.isDirectory()) {
15 const testDir = path_1.default.join(fixturesDir, testEntry.name);
16 const testFile = fs_1.default.readdirSync(testDir).find((fileName) => inputRegExp.test(fileName));
17 if (testFile) {
18 // TODO: Remove this as soon as the real test is fixed
19 (0, vitest_1.it)('true', () => {
20 (0, vitest_1.expect)(true).toEqual(true);
21 });
22 // TODO: Fix this test
23 // it(`${testEntry.name}`, () => {
24 // const inputPath = path.join(testDir, testFile);
25 // // snapshot the output of compodoc
26 // const compodocOutput = runCompodoc(inputPath);
27 // const compodocJson = JSON.parse(compodocOutput);
28 // expect(compodocJson).toMatchFileSnapshot(
29 // path.join(testDir, `compodoc-${SNAPSHOT_OS}.snapshot`)
30 // );
31 // // snapshot the output of addon-docs angular-properties
32 // const componentData = findComponentByName('InputComponent', compodocJson);
33 // const argTypes = extractArgTypesFromData(componentData);
34 // expect(argTypes).toMatchFileSnapshot(path.join(testDir, 'argtypes.snapshot'));
35 // });
36 }
37 }
38 });
39});