Build source maps (#8695)

Builds source maps, so we can debug our frontend code on stage and production.
This commit is contained in:
Max 2025-06-25 13:24:46 +02:00 committed by GitHub
parent 75d106e847
commit 2a54dc9664
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 38 additions and 14 deletions

View File

@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7
uses: actions/checkout@09d2acae674a48949e3602304ab46fd20ae0c42f # v4.2.2
- name: Copy backend env file
run: |
@ -46,7 +46,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7
uses: actions/checkout@09d2acae674a48949e3602304ab46fd20ae0c42f # v4.2.2
- name: Copy backend env file
run: |
@ -69,7 +69,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7
uses: actions/checkout@09d2acae674a48949e3602304ab46fd20ae0c42f # v4.2.2
- name: Setup Node.js
uses: actions/setup-node@08f58d1471bff7f3a07d167b4ad7df25d5fcfcb6 # v4.4.0
with:
node-version-file: 'backend/.tool-versions'
cache: 'yarn'
- name: Copy env files
run: |
@ -107,6 +113,15 @@ jobs:
# run copies of the current job in parallel
job: [1, 2, 3, 4, 5, 6, 7, 8]
steps:
- name: Checkout code
uses: actions/checkout@09d2acae674a48949e3602304ab46fd20ae0c42f # v4.2.2
- name: Setup Node.js
uses: actions/setup-node@08f58d1471bff7f3a07d167b4ad7df25d5fcfcb6 # v4.4.0
with:
node-version-file: 'backend/.tool-versions'
cache: 'yarn'
- name: Restore cypress cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.0.2
with:
@ -172,7 +187,7 @@ jobs:
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7
uses: actions/checkout@09d2acae674a48949e3602304ab46fd20ae0c42f # v4.2.2
- name: Full stack tests | cleanup cache
run: |

View File

@ -1,14 +1,7 @@
import { defineStep } from '@badeball/cypress-cucumber-preprocessor'
defineStep('I see all the reported posts including the one from above', () => {
cy.intercept({
method: 'POST',
url: '/api',
hostname: 'localhost',
}).as('getReports')
cy.wait(['@getReports'],{ timeout: 30000 }).then((interception) => {
console.log('Cypress interception:', interception)
cy.wait('@reportsQuery', { timeout: 30000 }).then((interception) => {
cy.wrap(interception.response.statusCode).should('eq', 200)
cy.wrap(interception.request.body)
.should('have.property', 'query', `query ($orderBy: ReportOrdering, $first: Int, $offset: Int, $reviewed: Boolean, $closed: Boolean) {
@ -104,6 +97,6 @@ defineStep('I see all the reported posts including the one from above', () => {
})
cy.get('table tbody').within(() => {
cy.contains('tr', 'The Truth about the Holocaust')
cy.contains('tr', 'The Truth about the Holocaust').should('be.visible')
})
})
})

View File

@ -14,6 +14,18 @@ defineStep('I click on {string}', element => {
'Moderation': 'a[href="/moderation"]',
}
if (element === 'Moderation') {
cy.intercept({
method: 'POST',
url: '/api',
hostname: 'localhost',
}, (req) => {
if (req.body && req.body.query && req.body.query.includes('query ($orderBy: ReportOrdering')) {
req.alias = 'reportsQuery'
}
})
}
cy.get(elementSelectors[element])
.click()
.wait(750)

View File

@ -261,6 +261,10 @@ export default {
},
}
if (ctx.isClient) {
config.devtool = 'source-map'
}
config.resolve.alias['~@'] = path.resolve(__dirname, '/')
config.resolve.alias['@@'] = path.resolve(__dirname, '/')