mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Remove unused vars and fix typo. (#5752)
- Removed unused "render" and "appPort" var from tests - Fix typo on "occured" to "occurred"
This commit is contained in:
parent
9d30e411b5
commit
48d3ae2dd6
|
@ -47,7 +47,7 @@ const RegisterBox = ({ client }) => {
|
|||
|
||||
name.value = email.value = password.value = ''
|
||||
}}>
|
||||
{error && <p>Issue occured while registering :(</p>}
|
||||
{error && <p>Issue occurred while registering :(</p>}
|
||||
<input name='name' placeholder='Name' ref={node => { name = node }} /><br />
|
||||
<input name='email' placeholder='Email' ref={node => { email = node }} /><br />
|
||||
<input name='password' placeholder='Password' ref={node => { password = node }} type='password' /><br />
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
if (typeof window !== 'undefined') {
|
||||
throw new Error('An Expected error occured')
|
||||
throw new Error('An Expected error occurred')
|
||||
}
|
||||
|
||||
export default () => <div />
|
||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react'
|
|||
export default class ErrorInRenderPage extends React.Component {
|
||||
render () {
|
||||
if (typeof window !== 'undefined') {
|
||||
throw new Error('An Expected error occured')
|
||||
throw new Error('An Expected error occurred')
|
||||
}
|
||||
return <div />
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import webdriver from 'next-webdriver'
|
||||
import {waitFor, getReactErrorOverlayContent} from 'next-test-utils'
|
||||
|
||||
export default (context, render) => {
|
||||
export default (context) => {
|
||||
describe('Client Navigation', () => {
|
||||
describe('with <Link/>', () => {
|
||||
it('should navigate the page', async () => {
|
||||
|
@ -664,7 +664,7 @@ export default (context, render) => {
|
|||
browser = await webdriver(context.appPort, '/error-inside-browser-page')
|
||||
await waitFor(3000)
|
||||
const text = await getReactErrorOverlayContent(browser)
|
||||
expect(text).toMatch(/An Expected error occured/)
|
||||
expect(text).toMatch(/An Expected error occurred/)
|
||||
expect(text).toMatch(/pages\/error-inside-browser-page\.js:5/)
|
||||
} finally {
|
||||
if (browser) {
|
||||
|
@ -679,7 +679,7 @@ export default (context, render) => {
|
|||
browser = await webdriver(context.appPort, '/error-in-the-browser-global-scope')
|
||||
await waitFor(3000)
|
||||
const text = await getReactErrorOverlayContent(browser)
|
||||
expect(text).toMatch(/An Expected error occured/)
|
||||
expect(text).toMatch(/An Expected error occurred/)
|
||||
expect(text).toMatch(/error-in-the-browser-global-scope\.js:2/)
|
||||
} finally {
|
||||
if (browser) {
|
||||
|
|
|
@ -3,7 +3,7 @@ import webdriver from 'next-webdriver'
|
|||
import { join } from 'path'
|
||||
import { check, File, waitFor, getReactErrorOverlayContent, getBrowserBodyText } from 'next-test-utils'
|
||||
|
||||
export default (context, render) => {
|
||||
export default (context) => {
|
||||
describe('Error Recovery', () => {
|
||||
it('should recover from 404 after a page has been added', async () => {
|
||||
let browser
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* eslint-env jest */
|
||||
import webdriver from 'next-webdriver'
|
||||
|
||||
export default (context, render) => {
|
||||
export default (context) => {
|
||||
describe('process.env', () => {
|
||||
it('should set process.env.NODE_ENV in development', async () => {
|
||||
const browser = await webdriver(context.appPort, '/process-env')
|
||||
|
|
|
@ -4,7 +4,7 @@ import cheerio from 'cheerio'
|
|||
import {BUILD_MANIFEST, REACT_LOADABLE_MANIFEST} from 'next-server/constants'
|
||||
import { join } from 'path'
|
||||
|
||||
export default function ({ app }, suiteName, render, fetch, appPort) {
|
||||
export default function ({ app }, suiteName, render, fetch) {
|
||||
async function get$ (path, query) {
|
||||
const html = await render(path, query)
|
||||
return cheerio.load(html)
|
||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react'
|
|||
export default class ErrorInRenderPage extends React.Component {
|
||||
render () {
|
||||
if (typeof window !== 'undefined') {
|
||||
const error = new Error('An Expected error occured')
|
||||
const error = new Error('An Expected error occurred')
|
||||
// This will be extracted by getInitialProps in the _error page,
|
||||
// which will result in a different error message being rendered.
|
||||
error.statusCode = 404
|
||||
|
|
Loading…
Reference in a new issue