Skip to content

Commit c3d2d65

Browse files
committed
Assert xmls are present in the bundle
1 parent 71a63b6 commit c3d2d65

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

packages/command-tests/commands.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ async function main() {
228228
) {
229229
throw new Error("Expected mpk file to be generated, but it wasn't.");
230230
}
231+
checkWidgetBundleFiles();
231232
}
232233

233234
async function testRelease() {
@@ -244,6 +245,18 @@ async function main() {
244245
) {
245246
throw new Error("Expected mpk file to be generated, but it wasn't.");
246247
}
248+
checkWidgetBundleFiles();
249+
}
250+
251+
function checkWidgetBundleFiles() {
252+
// XML files copied into the staging dir before zipping; missing here means a broken mpk.
253+
const stagingDir = join(workDir, "dist", "tmp", "widgets");
254+
const missing = ["package.xml", `${widgetPackageJson.widgetName}.xml`].filter(
255+
f => !existsSync(join(stagingDir, f))
256+
);
257+
if (missing.length) {
258+
throw new Error(`Expected widget bundle files in mpk, but missing: ${missing.join(", ")}.`);
259+
}
247260
}
248261

249262
async function checkDependenciesFiles(isNative, boilerplate, version) {

0 commit comments

Comments
 (0)