Skip to content

Commit

Permalink
add cache test
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachJW34 committed Jul 19, 2022
1 parent 7a65ef8 commit 3363d1a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions npm/webpack-dev-server/test/handlers/nextHandler.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ const expectGlobalStyleOverrides = (webpackConfig: Configuration) => {
cssRules.forEach((rule) => expect(rule.issuer).to.be.undefined)
}

const expectCacheOverrides = (webpackConfig: Configuration, projectRoot: string) => {
const cache: any = webpackConfig.cache

// No cache for Webpack 4
if (!cache || !cache.cacheDirectory) {
return
}

expect(cache.cacheDirectory).eq(path.join(projectRoot, '.next', 'cache', 'cypress-webpack'))
}

describe('nextHandler', function () {
// can take a while since we install node_modules
this.timeout(1000 * 60)
Expand All @@ -57,6 +68,7 @@ describe('nextHandler', function () {
expectPagesDir(webpackConfig, projectRoot)
expectWebpackSpan(webpackConfig)
expectGlobalStyleOverrides(webpackConfig)
expectCacheOverrides(webpackConfig, projectRoot)

expect(sourceWebpackModulesResult.webpack.importPath).to.include('next')
expect(sourceWebpackModulesResult.webpack.majorVersion).eq(5)
Expand All @@ -76,6 +88,7 @@ describe('nextHandler', function () {
expectPagesDir(webpackConfig, projectRoot)
expectWebpackSpan(webpackConfig)
expectGlobalStyleOverrides(webpackConfig)
expectCacheOverrides(webpackConfig, projectRoot)

expect(sourceWebpackModulesResult.webpack.importPath).to.include('next')
expect(sourceWebpackModulesResult.webpack.majorVersion).eq(5)
Expand All @@ -95,6 +108,7 @@ describe('nextHandler', function () {
expectPagesDir(webpackConfig, projectRoot)
expectWebpackSpan(webpackConfig)
expectGlobalStyleOverrides(webpackConfig)
expectCacheOverrides(webpackConfig, projectRoot)

expect(sourceWebpackModulesResult.webpack.importPath).to.include('next')
expect(sourceWebpackModulesResult.webpack.majorVersion).eq(4)
Expand Down

3 comments on commit 3363d1a

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 3363d1a Jul 19, 2022

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:

npm install https://cdn.cypress.io/beta/npm/10.3.1/linux-x64/zachw/issue-22525-3363d1a661621f4b1472203009e42edadfe01c58/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 3363d1a Jul 19, 2022

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 arm64 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:

npm install https://cdn.cypress.io/beta/npm/10.3.1/darwin-arm64/zachw/issue-22525-3363d1a661621f4b1472203009e42edadfe01c58/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 3363d1a Jul 19, 2022

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:

npm install https://cdn.cypress.io/beta/npm/10.3.1/darwin-x64/zachw/issue-22525-3363d1a661621f4b1472203009e42edadfe01c58/cypress.tgz

Please sign in to comment.