Skip to content

Bump @babel/preset-env from 7.25.3 to 7.25.4 #1420

Bump @babel/preset-env from 7.25.3 to 7.25.4

Bump @babel/preset-env from 7.25.3 to 7.25.4 #1420

Workflow file for this run

name: Self Tests
on:
pull_request:
branches: [ master ]
jobs:
comment:
if: ${{ !startsWith(github.event.pull_request.head.ref, 'dependabot') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Self test basic comment
uses: ./
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lcov-file: test-resources/lcov.info
pr-number: ${{ github.event.pull_request.number }}
- name: Compare comment
uses: actions/github-script@v7
with:
script: |
const comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ github.event.pull_request.number }}
});
const lastComment = comments.data[comments.data.length-1];
const comment = await github.rest.issues.getComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: lastComment.id
});
var fs = require('fs').promises;
const expectedTemplate = await fs.readFile("test-resources/comment.html", "utf-8");
const expected = expectedTemplate.replace("XXX", "${{github.event.pull_request.head.ref }}")
.replace("YYY", "${{github.event.pull_request.base.ref }}")
.replace(/ZZZ/g, "${{github.event.pull_request.head.sha }}");
const got = comment.data.body;
if (expected.trim() != got.trim()) {
throw 'Strings are not equal';
}
file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Self test file output
uses: ./
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lcov-file: test-resources/lcov.info
pr-number: ${{ github.event.pull_request.number }}
output-file: test.html
- name: 'Compare Output'
uses: actions/github-script@v7
with:
script: |
var fs = require('fs').promises;
const expectedTemplate = await fs.readFile("test-resources/comment.html", "utf-8");
const expected = expectedTemplate.replace("XXX", "${{github.event.pull_request.head.ref }}")
.replace("YYY", "${{github.event.pull_request.base.ref }}")
.replace(/ZZZ/g, "${{github.event.pull_request.head.sha }}");
const got = await fs.readFile("test.html", "utf-8");
if (expected.trim() != got.trim()) {
throw 'Strings are not equal';
}
hide-branch-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Self test no branch coverage in file
uses: ./
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lcov-file: test-resources/lcov.info
pr-number: ${{ github.event.pull_request.number }}
output-file: test-no-branch.html
hide-branch-coverage: true
- name: 'Compare Output'
uses: actions/github-script@v7
with:
script: |
var fs = require('fs').promises;
const expectedTemplate = await fs.readFile("test-resources/comment-without-branch.html", "utf-8");
const expected = expectedTemplate.replace("XXX", "${{github.event.pull_request.head.ref }}")
.replace("YYY", "${{github.event.pull_request.base.ref }}")
.replace(/ZZZ/g, "${{github.event.pull_request.head.sha }}");
const got = await fs.readFile("test-no-branch.html", "utf-8");
if (expected.trim() != got.trim()) {
throw 'Strings are not equal';
}