@lovrozagar/grunt 0.11.1 → 0.11.2
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/cli/init.mjs +6 -0
- package/cli/init.test.ts +2 -1
- package/package.json +1 -1
package/cli/init.mjs
CHANGED
|
@@ -531,6 +531,12 @@ export function mergePackageJson(dest, pkgRoot) {
|
|
|
531
531
|
const ownedLegacy =
|
|
532
532
|
legacy != null &&
|
|
533
533
|
(legacy.startsWith(v) || extraOwnedSuffix(legacy, v) != null || looksGruntOwnedPrefix(legacy))
|
|
534
|
+
// A repo that runs its own e2e keeps it as the only one: grunt's would rerun it without the
|
|
535
|
+
// repo's own steps (a build first, say).
|
|
536
|
+
if (k === "test:e2e" && current == null && legacy != null && !ownedLegacy) {
|
|
537
|
+
console.warn(`script \`${k}\` is the repo's own; not writing \`${destKey}\``)
|
|
538
|
+
continue
|
|
539
|
+
}
|
|
534
540
|
if (current != null) {
|
|
535
541
|
destPkg.scripts[destKey] = mergeScriptValue(v, current, historical)
|
|
536
542
|
} else if (ownedLegacy) {
|
package/cli/init.test.ts
CHANGED
|
@@ -1802,7 +1802,8 @@ describe("mergePackageJson", () => {
|
|
|
1802
1802
|
mergePackageJson(dest, PKG_ROOT);
|
|
1803
1803
|
const out = JSON.parse(fs.readFileSync(path.join(dest, "package.json"), "utf8"));
|
|
1804
1804
|
expect(out.scripts["test:e2e"]).toBe(own);
|
|
1805
|
-
|
|
1805
|
+
// The repo runs its own e2e: a second, grunt's, would run it again without the repo's own steps.
|
|
1806
|
+
expect(out.scripts["grunt:test:e2e"]).toBeUndefined();
|
|
1806
1807
|
});
|
|
1807
1808
|
|
|
1808
1809
|
it("keeps an existing grunt:test:e2e even without an e2e config", () => {
|
package/package.json
CHANGED