@immense/vue-pom-generator 1.0.96 → 1.0.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -0
- package/RELEASE_NOTES.md +21 -57
- package/class-generation/index.ts +315 -3
- package/class-generation/vue-test-utils-pom.ts +112 -0
- package/dist/class-generation/index.d.ts +2 -0
- package/dist/class-generation/index.d.ts.map +1 -1
- package/dist/class-generation/vue-test-utils-pom.d.ts +28 -0
- package/dist/class-generation/vue-test-utils-pom.d.ts.map +1 -0
- package/dist/index.cjs +259 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +259 -3
- package/dist/index.mjs.map +1 -1
- package/dist/plugin/create-vue-pom-generator-plugins.d.ts.map +1 -1
- package/dist/plugin/internal/build-plugin.d.ts.map +1 -1
- package/dist/plugin/internal/dev-plugin.d.ts.map +1 -1
- package/dist/plugin/resolved-generation-options.d.ts +1 -0
- package/dist/plugin/resolved-generation-options.d.ts.map +1 -1
- package/dist/plugin/types.d.ts +9 -0
- package/dist/plugin/types.d.ts.map +1 -1
- package/dist/pom-discoverability.d.ts +0 -1
- package/dist/pom-discoverability.d.ts.map +1 -1
- package/dist/pom-params.d.ts +0 -6
- package/dist/pom-params.d.ts.map +1 -1
- package/dist/pom-patterns.d.ts +0 -3
- package/dist/pom-patterns.d.ts.map +1 -1
- package/dist/router-introspection.d.ts +0 -1
- package/dist/router-introspection.d.ts.map +1 -1
- package/dist/scripts/floating-ui-runtime-entry.d.ts +2 -0
- package/dist/scripts/floating-ui-runtime-entry.d.ts.map +1 -0
- package/dist/tests/broad/helpers/fake-runtime.d.ts +2 -6
- package/dist/tests/broad/helpers/fake-runtime.d.ts.map +1 -1
- package/dist/tests/vue-test-utils-pom.test.d.ts +2 -0
- package/dist/tests/vue-test-utils-pom.test.d.ts.map +1 -0
- package/dist/utils.d.ts +2 -14
- package/dist/utils.d.ts.map +1 -1
- package/package.json +6 -1
package/dist/index.mjs
CHANGED
|
@@ -213,6 +213,7 @@ function resolveGenerationSupportOptions(options) {
|
|
|
213
213
|
typescriptOutputStructure: options.typescriptOutputStructure ?? "aggregated",
|
|
214
214
|
csharp: options.csharp,
|
|
215
215
|
generateFixtures: options.generateFixtures,
|
|
216
|
+
vueTestUtilsOutDir: options.vueTestUtilsOutDir?.trim() || void 0,
|
|
216
217
|
customPomAttachments: options.customPomAttachments ?? [],
|
|
217
218
|
customPomDir: options.customPomDir ?? "tests/playwright/pom/custom",
|
|
218
219
|
requireCustomPomDir: options.requireCustomPomDir ?? false,
|
|
@@ -5525,11 +5526,11 @@ function generateMethodMembersFromPom(componentName, primary, targetPageObjectMo
|
|
|
5525
5526
|
primary.parameters
|
|
5526
5527
|
);
|
|
5527
5528
|
}
|
|
5528
|
-
function
|
|
5529
|
+
function getUniquePrimaryPomSpecs(dependencies) {
|
|
5529
5530
|
const entries = Array.from(dependencies.dataTestIdSet ?? []);
|
|
5530
5531
|
const primarySpecsAll = entries.map((e) => ({ pom: e.pom, target: e.targetPageObjectModelClass })).filter((x) => !!x.pom).sort((a, b) => a.pom.methodName.localeCompare(b.pom.methodName));
|
|
5531
5532
|
const seenPrimaryKeys = /* @__PURE__ */ new Set();
|
|
5532
|
-
|
|
5533
|
+
return primarySpecsAll.filter(({ pom, target }) => {
|
|
5533
5534
|
const alternates = (pom.alternateSelectors ?? []).slice().sort((a, b) => JSON.stringify(a).localeCompare(JSON.stringify(b)));
|
|
5534
5535
|
const key = JSON.stringify({
|
|
5535
5536
|
role: pom.nativeRole,
|
|
@@ -5547,6 +5548,9 @@ function generateMethodsContentForDependencies(componentName, dependencies) {
|
|
|
5547
5548
|
seenPrimaryKeys.add(key);
|
|
5548
5549
|
return true;
|
|
5549
5550
|
});
|
|
5551
|
+
}
|
|
5552
|
+
function generateMethodsContentForDependencies(componentName, dependencies) {
|
|
5553
|
+
const primarySpecs = getUniquePrimaryPomSpecs(dependencies);
|
|
5550
5554
|
const extras = (dependencies.pomExtraMethods ?? []).slice().sort((a, b) => a.name.localeCompare(b.name));
|
|
5551
5555
|
const members = [];
|
|
5552
5556
|
for (const { pom, target } of primarySpecs) {
|
|
@@ -5561,6 +5565,7 @@ async function generateFiles(componentHierarchyMap, vueFilesPathMap, basePageCla
|
|
|
5561
5565
|
const {
|
|
5562
5566
|
outDir: outDirOverride,
|
|
5563
5567
|
generateFixtures,
|
|
5568
|
+
vueTestUtilsOutDir,
|
|
5564
5569
|
customPomAttachments = [],
|
|
5565
5570
|
projectRoot,
|
|
5566
5571
|
customPomDir,
|
|
@@ -5582,6 +5587,9 @@ async function generateFiles(componentHierarchyMap, vueFilesPathMap, basePageCla
|
|
|
5582
5587
|
} = options;
|
|
5583
5588
|
const emitLanguages = emitLanguagesOverride?.length ? emitLanguagesOverride : ["ts"];
|
|
5584
5589
|
const outDir = outDirOverride ?? "./pom";
|
|
5590
|
+
if (vueTestUtilsOutDir && path.resolve(vueTestUtilsOutDir) === path.resolve(outDir)) {
|
|
5591
|
+
throw new Error("[vue-pom-generator] generation.vueTestUtils.outDir must differ from generation.outDir.");
|
|
5592
|
+
}
|
|
5585
5593
|
const routeMetaByComponent = routeMetaByComponentOverride ?? (vueRouterFluentChaining ? await getRouteMetaByComponent(projectRoot, routerEntry, routerType, {
|
|
5586
5594
|
pageDirs,
|
|
5587
5595
|
componentDirs,
|
|
@@ -5640,11 +5648,247 @@ async function generateFiles(componentHierarchyMap, vueFilesPathMap, basePageCla
|
|
|
5640
5648
|
writeGeneratedFile(file);
|
|
5641
5649
|
}
|
|
5642
5650
|
}
|
|
5651
|
+
if (vueTestUtilsOutDir) {
|
|
5652
|
+
const vueTestUtilsFiles = generateVueTestUtilsFiles(
|
|
5653
|
+
emittableComponentHierarchyMap,
|
|
5654
|
+
vueTestUtilsOutDir,
|
|
5655
|
+
{ testIdAttribute }
|
|
5656
|
+
);
|
|
5657
|
+
for (const file of vueTestUtilsFiles) {
|
|
5658
|
+
writeGeneratedFile(file);
|
|
5659
|
+
}
|
|
5660
|
+
}
|
|
5643
5661
|
const gitattributesFiles = buildGeneratedGitAttributesFiles(generatedFilePaths);
|
|
5644
5662
|
for (const file of gitattributesFiles) {
|
|
5645
5663
|
createFile(file.filePath, file.content);
|
|
5646
5664
|
}
|
|
5647
5665
|
}
|
|
5666
|
+
const VUE_TEST_UTILS_OMITTED_PARAMETERS = /* @__PURE__ */ new Set(["annotationText", "timeOut", "timeout", "wait"]);
|
|
5667
|
+
function getVueTestUtilsParameters(parameters, patterns, options = {}) {
|
|
5668
|
+
return orderPomPatternParameters(parameters, patterns, options).filter((parameter) => !VUE_TEST_UTILS_OMITTED_PARAMETERS.has(parameter.name));
|
|
5669
|
+
}
|
|
5670
|
+
function getVueTestUtilsPrimaryMembers(primary) {
|
|
5671
|
+
if (primary.emitPrimary === false) {
|
|
5672
|
+
return [];
|
|
5673
|
+
}
|
|
5674
|
+
const selectors = uniquePomStringPatterns(primary.selector, primary.alternateSelectors);
|
|
5675
|
+
const parameters = getVueTestUtilsParameters(primary.parameters, selectors);
|
|
5676
|
+
const actionName = buildPomGeneratedActionName(primary);
|
|
5677
|
+
const selectorExpressions = selectors.map((selector) => toTypeScriptPomPatternExpression(selector));
|
|
5678
|
+
const targetExpression = selectorExpressions.length === 1 ? `this.getByTestId(${selectorExpressions[0]})` : `this.getByAnyTestId([${selectorExpressions.join(", ")}])`;
|
|
5679
|
+
let actionStatement;
|
|
5680
|
+
switch (primary.nativeRole) {
|
|
5681
|
+
case "input":
|
|
5682
|
+
actionStatement = `await ${targetExpression}.setValue(text);`;
|
|
5683
|
+
break;
|
|
5684
|
+
case "select":
|
|
5685
|
+
actionStatement = `await ${targetExpression}.setValue(value);`;
|
|
5686
|
+
break;
|
|
5687
|
+
case "vselect":
|
|
5688
|
+
actionStatement = selectors.length === 1 ? `await this.selectVSelectByTestId(${selectorExpressions[0]}, value);` : `await this.selectVSelectByAnyTestId([${selectorExpressions.join(", ")}], value);`;
|
|
5689
|
+
break;
|
|
5690
|
+
case "radio":
|
|
5691
|
+
actionStatement = `await ${targetExpression}.setValue();`;
|
|
5692
|
+
break;
|
|
5693
|
+
default:
|
|
5694
|
+
actionStatement = `await ${targetExpression}.trigger("click");`;
|
|
5695
|
+
break;
|
|
5696
|
+
}
|
|
5697
|
+
return [createClassMethod({
|
|
5698
|
+
name: actionName,
|
|
5699
|
+
isAsync: true,
|
|
5700
|
+
parameters: toTypeScriptPomParameterStructures(parameters),
|
|
5701
|
+
statements: [actionStatement]
|
|
5702
|
+
})];
|
|
5703
|
+
}
|
|
5704
|
+
function getVueTestUtilsExtraMembers(extra) {
|
|
5705
|
+
if (extra.kind !== "click") {
|
|
5706
|
+
return [];
|
|
5707
|
+
}
|
|
5708
|
+
const patterns = extra.selector.kind === "testId" ? [extra.selector.testId] : [extra.selector.rootTestId, extra.selector.label];
|
|
5709
|
+
const parameters = getVueTestUtilsParameters(extra.parameters, patterns, {
|
|
5710
|
+
omit: extra.keyLiteral === void 0 ? [] : ["key"]
|
|
5711
|
+
});
|
|
5712
|
+
return [createClassMethod({
|
|
5713
|
+
name: extra.name,
|
|
5714
|
+
isAsync: true,
|
|
5715
|
+
parameters: toTypeScriptPomParameterStructures(parameters),
|
|
5716
|
+
statements: (writer) => {
|
|
5717
|
+
if (extra.keyLiteral !== void 0) {
|
|
5718
|
+
writer.writeLine(`const key = ${JSON.stringify(extra.keyLiteral)};`);
|
|
5719
|
+
}
|
|
5720
|
+
if (extra.selector.kind === "testId") {
|
|
5721
|
+
writer.writeLine(`await this.clickByTestId(${toTypeScriptPomPatternExpression(extra.selector.testId)});`);
|
|
5722
|
+
return;
|
|
5723
|
+
}
|
|
5724
|
+
writer.writeLine(
|
|
5725
|
+
`await this.clickWithinTestIdByLabel(${toTypeScriptPomPatternExpression(extra.selector.rootTestId)}, ${toTypeScriptPomPatternExpression(extra.selector.label)}, ${extra.selector.exact ?? false});`
|
|
5726
|
+
);
|
|
5727
|
+
}
|
|
5728
|
+
})];
|
|
5729
|
+
}
|
|
5730
|
+
function getVueTestUtilsComponentMembers(componentInstances, projectedComponentInstances, testIdAttribute) {
|
|
5731
|
+
const members = [];
|
|
5732
|
+
for (const instance of componentInstances) {
|
|
5733
|
+
if (instance.parameters.length === 0) {
|
|
5734
|
+
members.push(createClassGetter({
|
|
5735
|
+
name: instance.instanceName,
|
|
5736
|
+
returnType: instance.className,
|
|
5737
|
+
statements: [
|
|
5738
|
+
`return new ${instance.className}(this.getComponentInstance(${toTypeScriptPomPatternExpression(instance.selector)}));`
|
|
5739
|
+
]
|
|
5740
|
+
}));
|
|
5741
|
+
continue;
|
|
5742
|
+
}
|
|
5743
|
+
members.push(createClassMethod({
|
|
5744
|
+
name: instance.instanceName,
|
|
5745
|
+
parameters: toTypeScriptPomParameterStructures(instance.parameters),
|
|
5746
|
+
returnType: instance.className,
|
|
5747
|
+
statements: [
|
|
5748
|
+
`return new ${instance.className}(this.getComponentInstance(${toTypeScriptPomPatternExpression(instance.selector)}));`
|
|
5749
|
+
]
|
|
5750
|
+
}));
|
|
5751
|
+
}
|
|
5752
|
+
for (const projection of projectedComponentInstances) {
|
|
5753
|
+
const projectedPropertiesType = projection.contents.length > 0 ? ` & { ${projection.contents.map((content) => `readonly ${content.instanceName}: ${content.className}`).join("; ")} }` : "";
|
|
5754
|
+
const statements = (writer) => {
|
|
5755
|
+
writer.writeLine(`const ownerRoot = this.getComponentInstance(${toTypeScriptPomPatternExpression(projection.owner.selector)});`);
|
|
5756
|
+
writer.writeLine(`const root = this.getComponentInstance(${toTypeScriptPomPatternExpression(projection.target.selector)}, ownerRoot);`);
|
|
5757
|
+
writer.writeLine(`const instance = new ${projection.target.className}(root);`);
|
|
5758
|
+
if (projection.contents.length === 0) {
|
|
5759
|
+
writer.writeLine("return instance;");
|
|
5760
|
+
return;
|
|
5761
|
+
}
|
|
5762
|
+
writer.writeLine("return Object.assign(instance, {");
|
|
5763
|
+
writer.indent(() => {
|
|
5764
|
+
for (const content of projection.contents) {
|
|
5765
|
+
writer.writeLine(
|
|
5766
|
+
`${content.instanceName}: new ${content.className}(this.getComponentInstance(${toTypeScriptPomPatternExpression(content.selector)}, root)),`
|
|
5767
|
+
);
|
|
5768
|
+
}
|
|
5769
|
+
});
|
|
5770
|
+
writer.writeLine("});");
|
|
5771
|
+
};
|
|
5772
|
+
const returnType = `${projection.target.className}${projectedPropertiesType}`;
|
|
5773
|
+
members.push(projection.target.parameters.length > 0 ? createClassMethod({
|
|
5774
|
+
name: projection.target.instanceName,
|
|
5775
|
+
parameters: toTypeScriptPomParameterStructures(projection.target.parameters),
|
|
5776
|
+
returnType,
|
|
5777
|
+
statements
|
|
5778
|
+
}) : createClassGetter({
|
|
5779
|
+
name: projection.target.instanceName,
|
|
5780
|
+
returnType,
|
|
5781
|
+
statements
|
|
5782
|
+
}));
|
|
5783
|
+
}
|
|
5784
|
+
members.push(createClassConstructor({
|
|
5785
|
+
parameters: [{ name: "wrapper", type: "VueTestUtilsPomRoot" }],
|
|
5786
|
+
statements: (writer) => {
|
|
5787
|
+
writer.writeLine(`super(wrapper, { testIdAttribute: ${JSON.stringify(testIdAttribute)} });`);
|
|
5788
|
+
}
|
|
5789
|
+
}));
|
|
5790
|
+
return members;
|
|
5791
|
+
}
|
|
5792
|
+
function generateVueTestUtilsContent(componentName, dependencies, componentHierarchyMap, outputDir, runtimePath, generatedFilePathByComponent, testIdAttribute) {
|
|
5793
|
+
const prepared = prepareViewObjectModelClass(componentName, dependencies, componentHierarchyMap, {
|
|
5794
|
+
testIdAttribute
|
|
5795
|
+
});
|
|
5796
|
+
const runtimeImport = stripExtension(toPosixRelativePath(outputDir, runtimePath));
|
|
5797
|
+
const sourceRel = toPosixRelativePath(outputDir, dependencies.filePath);
|
|
5798
|
+
const componentImports = Array.from(prepared.componentRefsForInstances).map((componentRef) => {
|
|
5799
|
+
const className = componentRef.endsWith(".vue") ? componentRef.slice(0, -4) : componentRef;
|
|
5800
|
+
const filePath = generatedFilePathByComponent.get(className);
|
|
5801
|
+
return filePath ? { className, moduleSpecifier: stripExtension(toPosixRelativePath(outputDir, filePath)) } : null;
|
|
5802
|
+
}).filter((value) => !!value).sort((left, right) => left.className.localeCompare(right.className));
|
|
5803
|
+
const members = [
|
|
5804
|
+
...getVueTestUtilsComponentMembers(
|
|
5805
|
+
prepared.directComponentInstances,
|
|
5806
|
+
prepared.projectedComponentInstances,
|
|
5807
|
+
testIdAttribute
|
|
5808
|
+
),
|
|
5809
|
+
...getUniquePrimaryPomSpecs(dependencies).flatMap(({ pom }) => getVueTestUtilsPrimaryMembers(pom)),
|
|
5810
|
+
...(dependencies.pomExtraMethods ?? []).flatMap(getVueTestUtilsExtraMembers)
|
|
5811
|
+
];
|
|
5812
|
+
return renderSourceFile(`${componentName}.vtu.g.ts`, (sourceFile) => {
|
|
5813
|
+
addNamedImport(sourceFile, {
|
|
5814
|
+
moduleSpecifier: runtimeImport,
|
|
5815
|
+
namedImports: ["VueTestUtilsPom"]
|
|
5816
|
+
});
|
|
5817
|
+
addNamedImport(sourceFile, {
|
|
5818
|
+
moduleSpecifier: runtimeImport,
|
|
5819
|
+
namedImports: ["VueTestUtilsPomRoot"],
|
|
5820
|
+
isTypeOnly: true
|
|
5821
|
+
});
|
|
5822
|
+
for (const componentImport of componentImports) {
|
|
5823
|
+
addNamedImport(sourceFile, {
|
|
5824
|
+
moduleSpecifier: componentImport.moduleSpecifier,
|
|
5825
|
+
namedImports: [componentImport.className]
|
|
5826
|
+
});
|
|
5827
|
+
}
|
|
5828
|
+
const declaration = sourceFile.addClass({
|
|
5829
|
+
name: prepared.className,
|
|
5830
|
+
isExported: true,
|
|
5831
|
+
extends: "VueTestUtilsPom",
|
|
5832
|
+
docs: [`Vue Test Utils object for ${componentName} (source: ${sourceRel}).`]
|
|
5833
|
+
});
|
|
5834
|
+
for (const member of members) {
|
|
5835
|
+
addClassMember(declaration, member);
|
|
5836
|
+
}
|
|
5837
|
+
}, {
|
|
5838
|
+
prefixText: buildFilePrefix({ eslintDisableSortImports: true })
|
|
5839
|
+
});
|
|
5840
|
+
}
|
|
5841
|
+
function generateVueTestUtilsFiles(componentHierarchyMap, outDir, options = {}) {
|
|
5842
|
+
const base = ensureDir(outDir);
|
|
5843
|
+
const testIdAttribute = options.testIdAttribute?.trim() || "data-testid";
|
|
5844
|
+
const entries = Array.from(componentHierarchyMap.entries()).sort((left, right) => left[0].localeCompare(right[0]));
|
|
5845
|
+
const generatedFilePathByComponent = new Map(
|
|
5846
|
+
entries.map(([componentName]) => [componentName, path.join(base, `${componentName}.vtu.g.ts`)])
|
|
5847
|
+
);
|
|
5848
|
+
const runtimePath = path.join(base, "_pom-runtime", "vue-test-utils-pom.ts");
|
|
5849
|
+
const files = entries.map(([componentName, dependencies]) => {
|
|
5850
|
+
const filePath = generatedFilePathByComponent.get(componentName);
|
|
5851
|
+
return {
|
|
5852
|
+
filePath,
|
|
5853
|
+
content: generateVueTestUtilsContent(
|
|
5854
|
+
componentName,
|
|
5855
|
+
dependencies,
|
|
5856
|
+
componentHierarchyMap,
|
|
5857
|
+
path.dirname(filePath),
|
|
5858
|
+
runtimePath,
|
|
5859
|
+
generatedFilePathByComponent,
|
|
5860
|
+
testIdAttribute
|
|
5861
|
+
)
|
|
5862
|
+
};
|
|
5863
|
+
});
|
|
5864
|
+
const [runtimeFile] = buildRuntimeGeneratedFilesFromSpecs([{
|
|
5865
|
+
absolutePath: resolvePluginAsset("../class-generation/vue-test-utils-pom.ts"),
|
|
5866
|
+
description: "vue-test-utils-pom.ts",
|
|
5867
|
+
outputPath: runtimePath
|
|
5868
|
+
}]);
|
|
5869
|
+
if (!runtimeFile) {
|
|
5870
|
+
throw new Error("[vue-pom-generator] Failed to generate the Vue Test Utils runtime.");
|
|
5871
|
+
}
|
|
5872
|
+
const indexContent = renderSourceFile("index.ts", (sourceFile) => {
|
|
5873
|
+
addExportAll(sourceFile, stripExtension(toPosixRelativePath(base, runtimePath)));
|
|
5874
|
+
for (const [, filePath] of generatedFilePathByComponent) {
|
|
5875
|
+
addExportAll(sourceFile, `./${stripExtension(path.basename(filePath))}`);
|
|
5876
|
+
}
|
|
5877
|
+
}, {
|
|
5878
|
+
prefixText: buildFilePrefix({
|
|
5879
|
+
eslintDisableSortImports: true,
|
|
5880
|
+
commentLines: [
|
|
5881
|
+
"Vue Test Utils POM exports",
|
|
5882
|
+
"DO NOT MODIFY BY HAND"
|
|
5883
|
+
]
|
|
5884
|
+
})
|
|
5885
|
+
});
|
|
5886
|
+
return [
|
|
5887
|
+
...files,
|
|
5888
|
+
{ filePath: path.join(base, "index.ts"), content: indexContent },
|
|
5889
|
+
runtimeFile
|
|
5890
|
+
];
|
|
5891
|
+
}
|
|
5648
5892
|
async function generateSplitTypeScriptFiles(componentHierarchyMap, vueFilesPathMap, basePageClassPath, outDir, options = {}) {
|
|
5649
5893
|
const projectRoot = options.projectRoot ?? process.cwd();
|
|
5650
5894
|
const entries = Array.from(componentHierarchyMap.entries()).sort((a, b) => a[0].localeCompare(b[0]));
|
|
@@ -7081,7 +7325,7 @@ function getRuntimeGeneratedAssetSpecs(baseDir, basePageClassPath) {
|
|
|
7081
7325
|
const runtimeDirAbs = path.join(baseDir, "_pom-runtime");
|
|
7082
7326
|
const runtimeClassGenAbs = path.join(runtimeDirAbs, "class-generation");
|
|
7083
7327
|
const runtimeClassGenSourceDir = resolvePluginAsset("../class-generation");
|
|
7084
|
-
const runtimeClassGenFiles = fs.readdirSync(runtimeClassGenSourceDir).filter((file) => file.endsWith(".ts")).filter((file) =>
|
|
7328
|
+
const runtimeClassGenFiles = fs.readdirSync(runtimeClassGenSourceDir).filter((file) => file.endsWith(".ts")).filter((file) => !["base-page.ts", "diagnostics.ts", "index.ts", "vue-test-utils-pom.ts"].includes(file)).sort((left, right) => left.localeCompare(right));
|
|
7085
7329
|
return [
|
|
7086
7330
|
{
|
|
7087
7331
|
absolutePath: resolvePluginAsset("../click-instrumentation.ts"),
|
|
@@ -9875,6 +10119,7 @@ function createBuildProcessorPlugin(options) {
|
|
|
9875
10119
|
typescriptOutputStructure,
|
|
9876
10120
|
csharp,
|
|
9877
10121
|
generateFixtures,
|
|
10122
|
+
vueTestUtilsOutDir,
|
|
9878
10123
|
customPomAttachments,
|
|
9879
10124
|
customPomDir,
|
|
9880
10125
|
requireCustomPomDir,
|
|
@@ -10091,6 +10336,7 @@ function createBuildProcessorPlugin(options) {
|
|
|
10091
10336
|
typescriptOutputStructure,
|
|
10092
10337
|
csharp,
|
|
10093
10338
|
generateFixtures,
|
|
10339
|
+
vueTestUtilsOutDir,
|
|
10094
10340
|
customPomAttachments,
|
|
10095
10341
|
projectRoot: projectRootRef.current,
|
|
10096
10342
|
customPomDir,
|
|
@@ -10139,6 +10385,7 @@ function createDevProcessorPlugin(options) {
|
|
|
10139
10385
|
typescriptOutputStructure,
|
|
10140
10386
|
csharp,
|
|
10141
10387
|
generateFixtures,
|
|
10388
|
+
vueTestUtilsOutDir,
|
|
10142
10389
|
customPomAttachments,
|
|
10143
10390
|
customPomDir,
|
|
10144
10391
|
requireCustomPomDir,
|
|
@@ -10397,6 +10644,7 @@ function createDevProcessorPlugin(options) {
|
|
|
10397
10644
|
typescriptOutputStructure,
|
|
10398
10645
|
csharp,
|
|
10399
10646
|
generateFixtures,
|
|
10647
|
+
vueTestUtilsOutDir,
|
|
10400
10648
|
customPomAttachments,
|
|
10401
10649
|
projectRoot: projectRootRef.current,
|
|
10402
10650
|
customPomDir,
|
|
@@ -11033,6 +11281,7 @@ function createVuePomGeneratorPlugins(options = {}) {
|
|
|
11033
11281
|
typescriptOutputStructure: generationOptions?.playwright?.outputStructure,
|
|
11034
11282
|
csharp: generationOptions?.csharp,
|
|
11035
11283
|
generateFixtures,
|
|
11284
|
+
vueTestUtilsOutDir: generationOptions?.vueTestUtils ? generationOptions.vueTestUtils.outDir ?? "tests/unit/__generated__" : void 0,
|
|
11036
11285
|
customPomAttachments: resolvedCustomPomAttachments,
|
|
11037
11286
|
customPomDir: customPoms?.dir,
|
|
11038
11287
|
requireCustomPomDir,
|
|
@@ -11067,6 +11316,7 @@ function createVuePomGeneratorPlugins(options = {}) {
|
|
|
11067
11316
|
layoutDirs: isNuxt ? null : getLayoutDirs(),
|
|
11068
11317
|
wrapperSearchRoots: isNuxt ? null : getWrapperSearchRoots(),
|
|
11069
11318
|
outDir: resolvedGenerationOptions.outDir,
|
|
11319
|
+
vueTestUtilsOutDir: resolvedGenerationOptions.vueTestUtilsOutDir,
|
|
11070
11320
|
testIdAttribute,
|
|
11071
11321
|
routerType: resolvedGenerationOptions.routerType,
|
|
11072
11322
|
vuePluginOwnership
|
|
@@ -11105,6 +11355,12 @@ function createVuePomGeneratorPlugins(options = {}) {
|
|
|
11105
11355
|
}
|
|
11106
11356
|
if (generationEnabled) {
|
|
11107
11357
|
assertNonEmptyString(resolvedGenerationOptions.outDir, "[vue-pom-generator] generation.outDir");
|
|
11358
|
+
if (generationOptions?.vueTestUtils) {
|
|
11359
|
+
assertNonEmptyString(resolvedGenerationOptions.vueTestUtilsOutDir, "[vue-pom-generator] generation.vueTestUtils.outDir");
|
|
11360
|
+
if (path.resolve(projectRootRef.current, resolvedGenerationOptions.vueTestUtilsOutDir) === path.resolve(projectRootRef.current, resolvedGenerationOptions.outDir)) {
|
|
11361
|
+
throw new Error("[vue-pom-generator] generation.vueTestUtils.outDir must differ from generation.outDir.");
|
|
11362
|
+
}
|
|
11363
|
+
}
|
|
11108
11364
|
assertOneOf(resolvedGenerationOptions.typescriptOutputStructure, ["aggregated", "split"], "[vue-pom-generator] generation.playwright.outputStructure");
|
|
11109
11365
|
assertRouterModuleShims(resolvedGenerationOptions.routerModuleShims, "[vue-pom-generator] generation.router.moduleShims");
|
|
11110
11366
|
if (!isNuxt && vueGenerationOptions?.router && resolvedGenerationOptions.routerType === "vue-router") {
|