Skip to content

Commit a7a23f7

Browse files
committed
test: run hmr restore tasks in after hook
1 parent bb96427 commit a7a23f7

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

e2e/tests/hmr/frontmatter.cy.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
if (Cypress.env('E2E_COMMAND') === 'dev') {
2+
after(() => {
3+
cy.task('hmr:frontmatter:restore')
4+
})
5+
26
it('should update frontmatter correctly', () => {
37
cy.visit('/hmr/frontmatter.html')
48
cy.get('.e2e-theme-content #rendered-foo + p').should(

e2e/tests/hmr/navigation.cy.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
if (Cypress.env('E2E_COMMAND') === 'dev') {
2+
after(() => {
3+
cy.task('hmr:title:restore')
4+
cy.task('hmr:frontmatter:restore')
5+
})
6+
27
it('should update title and frontmatter correctly after navigation', () => {
38
cy.visit('/hmr/title.html')
49
cy.title().should('include', 'HMR Title')

e2e/tests/hmr/title.cy.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
if (Cypress.env('E2E_COMMAND') === 'dev') {
2+
after(() => {
3+
cy.task('hmr:title:restore')
4+
})
5+
26
it('should update title correctly', () => {
37
cy.visit('/hmr/title.html')
48
cy.title().should('include', 'HMR Title')

0 commit comments

Comments
 (0)