-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add next preset to webpack-dev-server-fresh (#21069)
Co-authored-by: Tim Griesser <tgriesser10@gmail.com>
- Loading branch information
Showing
34 changed files
with
6,633 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// <reference types="cypress" /> | ||
/// <reference path="../support/e2e.ts" /> | ||
import type { ProjectFixtureDir } from '@tooling/system-tests/lib/fixtureDirs' | ||
|
||
const WEBPACK_REACT: ProjectFixtureDir[] = ['next-11', 'next-12', 'next-11-webpack-4'] | ||
|
||
// Add to this list to focus on a particular permutation | ||
const ONLY_PROJECTS: ProjectFixtureDir[] = [] | ||
|
||
for (const project of WEBPACK_REACT) { | ||
if (ONLY_PROJECTS.length && !ONLY_PROJECTS.includes(project)) { | ||
continue | ||
} | ||
|
||
describe(`Working with ${project}`, () => { | ||
beforeEach(() => { | ||
cy.scaffoldProject(project) | ||
cy.openProject(project) | ||
cy.startAppServer('component') | ||
}) | ||
|
||
it('should mount a passing test', () => { | ||
cy.visitApp() | ||
cy.contains('index.cy.js').click() | ||
cy.get('.passed > .num').should('contain', 1) | ||
}) | ||
|
||
it('should live-reload on src changes', () => { | ||
cy.visitApp() | ||
|
||
cy.contains('index.cy.js').click() | ||
cy.get('.passed > .num').should('contain', 1) | ||
|
||
cy.withCtx(async (ctx) => { | ||
const indexPath = ctx.path.join('pages', 'index.js') | ||
|
||
await ctx.actions.file.writeFileInProject( | ||
indexPath, | ||
(await ctx.file.readFileInProject(indexPath)).replace('Welcome to', 'Hello from'), | ||
) | ||
}) | ||
|
||
cy.get('.failed > .num', { timeout: 10000 }).should('contain', 1) | ||
|
||
cy.withCtx(async (ctx) => { | ||
const indexTestPath = ctx.path.join('pages', 'index.cy.js') | ||
|
||
await ctx.actions.file.writeFileInProject( | ||
indexTestPath, | ||
(await ctx.file.readFileInProject(indexTestPath)).replace('Welcome to', 'Hello from'), | ||
) | ||
}) | ||
|
||
cy.get('.passed > .num').should('contain', 1) | ||
}) | ||
|
||
it('should detect new spec', () => { | ||
cy.visitApp() | ||
|
||
cy.withCtx(async (ctx) => { | ||
const newTestPath = ctx.path.join('pages', 'New.cy.js') | ||
const indexTestPath = ctx.path.join('pages', 'index.cy.js') | ||
|
||
await ctx.actions.file.writeFileInProject( | ||
newTestPath, | ||
await ctx.file.readFileInProject(indexTestPath), | ||
) | ||
}) | ||
|
||
cy.contains('New.cy.js').click() | ||
cy.get('.passed > .num').should('contain', 1) | ||
}) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
ccfee1e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
linux x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally:
ccfee1e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
darwin x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally: