|
| 1 | +import { testBlock } from "bingo-stratum-testers"; |
| 2 | +import { describe, expect, test } from "vitest"; |
| 3 | + |
| 4 | +import { blockCTATransitions } from "./blockCTATransitions.js"; |
| 5 | +import { optionsBase } from "./options.fakes.js"; |
| 6 | + |
| 7 | +describe("blockCTATransitions", () => { |
| 8 | + test("production", () => { |
| 9 | + const creation = testBlock(blockCTATransitions, { |
| 10 | + options: optionsBase, |
| 11 | + }); |
| 12 | + |
| 13 | + expect(creation).toMatchInlineSnapshot(` |
| 14 | + { |
| 15 | + "addons": [ |
| 16 | + { |
| 17 | + "addons": { |
| 18 | + "jobs": [ |
| 19 | + { |
| 20 | + "checkoutWith": { |
| 21 | + "fetch-depth": "0", |
| 22 | + "ref": "\${{github.event.pull_request.head.ref}}", |
| 23 | + "repository": "\${{github.event.pull_request.head.repo.full_name}}", |
| 24 | + "token": ""\${{ secrets.ACCESS_TOKEN }}"", |
| 25 | + }, |
| 26 | + "if": "\${{ startsWith(github.head_ref, 'renovate/') && contains(github.event.pull_request.title, 'create-typescript-app') }}", |
| 27 | + "name": "CTA Transitions", |
| 28 | + "steps": [ |
| 29 | + { |
| 30 | + "run": "pnpx create-typescript-app", |
| 31 | + }, |
| 32 | + { |
| 33 | + "uses": "stefanzweifel/git-auto-commit-action@v5", |
| 34 | + "with": { |
| 35 | + "commit_author": "The Friendly Bingo Bot <[email protected]>", |
| 36 | + "commit_message": "Check in changes from re-running npx create-typescript-app", |
| 37 | + "commit_user_email": "[email protected]", |
| 38 | + "commit_user_name": "The Friendly Bingo Bot", |
| 39 | + }, |
| 40 | + }, |
| 41 | + { |
| 42 | + "uses": "mshick/add-pr-comment@v2", |
| 43 | + "with": { |
| 44 | + "issue": "\${{ github.event.pull_request.number }}", |
| 45 | + "message": "| |
| 46 | + 🤖 Beep boop! I ran \`npx create-typescript-app\` and found same changes. |
| 47 | + Please review the latest commit to see if you want to merge it. |
| 48 | + Cheers! 💝 |
| 49 | +
|
| 50 | + > This change was automatically made in CI to keep your repository up-to-date with the templating in [create-typescript-app](https://github.com/JoshuaKGoldberg/create-typescript-app). |
| 51 | + > If you want to opt out of these automatic updates, delete the \`.github/workflows/cta-transitions.yml\` file on your \`main\` branch.", |
| 52 | + "repo-token": "\${{ secrets.ACCESS_TOKEN }}", |
| 53 | + }, |
| 54 | + }, |
| 55 | + ], |
| 56 | + }, |
| 57 | + ], |
| 58 | + }, |
| 59 | + "block": [Function], |
| 60 | + }, |
| 61 | + { |
| 62 | + "addons": { |
| 63 | + "properties": { |
| 64 | + "devDependencies": { |
| 65 | + "create-typescript-app": "2.7.3", |
| 66 | + }, |
| 67 | + }, |
| 68 | + }, |
| 69 | + "block": [Function], |
| 70 | + }, |
| 71 | + ], |
| 72 | + } |
| 73 | + `); |
| 74 | + }); |
| 75 | +}); |
0 commit comments