Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[legacy-framework] fix integration test types and fix nextjs pnpm test #2212

Merged
merged 1 commit into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 27 additions & 23 deletions nextjs/test/lib/next-webdriver.d.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
interface Chain {
elementByCss: (selector: string) => Chain
elementById: () => Chain
getValue: () => Chain
text: () => Chain
type: () => Chain
moveTo: () => Chain
getComputedCss: () => Chain
getAttribute: () => Chain
hasElementByCssSelector: () => Chain
click: () => Chain
elementsByCss: () => Chain
waitForElementByCss: (arg: string) => Chain
eval: () => Chain
log: () => Chain
url: () => Chain
back: () => Chain
forward: () => Chain
refresh: () => Chain
setDimensions: (opts: { height: number; width: number }) => Chain
close: () => Chain
quit: () => Chain
interface ChainMethods {
elementByCss: (selector: string) => Chain<Element>
elementById: () => Chain<Element>
getValue: () => Chain<any>
text: () => Chain<string>
type: () => Chain<any>
moveTo: () => Chain<any>
getComputedCss: () => Chain<any>
getAttribute: () => Chain<any>
hasElementByCssSelector: () => Chain<any>
click: () => Chain<any>
elementsByCss: () => Chain<Element[]>
waitForElementByCss: (arg: string) => Chain<any>
eval: () => Chain<any>
log: () => Chain<any>
url: () => Chain<any>
back: () => Chain<any>
forward: () => Chain<any>
refresh: () => Chain<any>
setDimensions: (opts: { height: number; width: number }) => Chain<any>
close: () => Chain<any>
quit: () => Chain<any>
}

interface Chain<T> extends Promise<T & ChainMethods>, ChainMethods {}

type Browser = { __brand: 'Browser' }

export default function (
appPort: number,
path: string,
waitHydration?: boolean,
allowHydrationRetry?: boolean
): Promise<Chain>
): Promise<Chain<Browser>>
7 changes: 1 addition & 6 deletions nextjs/test/package-managers/pnpm/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import execa from 'execa'
import fs from 'fs-extra'
import os from 'os'
import path from 'path'
import symlink from 'symlink-dir'

const pnpmExecutable = path.join(
__dirname,
Expand Down Expand Up @@ -115,14 +114,10 @@ describe('pnpm support', () => {
).toBeTruthy()

const packageJson = await fs.readJson(packageJsonPath)
expect(packageJson.dependencies['@blitzjs/next']).toMatch(/^file:/)
expect(packageJson.dependencies['next']).toMatch(/^file:/)
for (const dependency of Object.keys(dependencyTarballPaths)) {
expect(packageJson.pnpm.overrides[dependency]).toMatch(/^file:/)
}
await symlink(
path.join(tempAppDir, 'node_modules/@blitzjs/next'),
path.join(tempAppDir, 'node_modules/next')
)

try {
const { stdout, stderr } = await runPnpm(tempAppDir, 'run', 'build')
Expand Down